Hydropower engineering document text vectorization conversion method based on spatial semantic correction
Through the vectorization conversion method of hydropower engineering document text based on spatial semantic correction, using automatic scanning instruments and intelligent algorithms, combined with HC-PSENet and HC-CRNN models, the low accuracy and low automation level of text interpretation in hydropower engineering construction documents is solved solve the problem, achieve efficient and automated transformation of hydropower project construction documents, and improve data service capabilities.
Patent Information
- Application Number
- CN202410648421.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-23
AI Technical Summary
The existing technology has problems with uncontrollable accuracy and low automation level in text interpretation of hydropower project construction documents. Especially due to the complex layout of the document and the characteristics of Chinese characters, the text recognition model has higher requirements for extracting character features. Existing OCR technology has insufficient adaptability.
A hydropower engineering document text vectorization conversion method based on spatial semantic correction is adopted, including the construction of automatic scanning instruments and intelligent algorithms. Through the text detection model HC-PSENet and the text recognition model HC-CRNN, combined with data enhancement and transfer learning strategies, hydropower engineering is realized Construction of automated conversion of unstructured text image data into editable text.
It realizes the efficient and rapid conversion of non-editable text in hydropower engineering construction into editable electronic documents, improves the data service capabilities in the field of water conservancy and hydropower engineering, and improves the accuracy and automation level of intelligent text processing.
Smart Images

Figure CN118675178A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of intelligent construction, and in particular to a method for vectorizing and converting hydropower engineering document text based on spatial semantic correction. Background Art
[0002] Faced with the huge number of hydropower project construction documents with complex data, manual interpretation is usually used to obtain information from non-editable documents. This method is too time-consuming and the accuracy is uncontrollable, especially when faced with complex layout documents, it is impossible to accurately quantify the time required and the accuracy.
[0003] The emergence of deep learning has brought about breakthrough progress in the fields of computer vision and pattern recognition. Text interpretation technology has expanded in depth and breadth, and the performance of text interpretation methods based on deep learning has been greatly improved in terms of accuracy and efficiency, and has gradually adapted to multi-domain documents with diverse characters and complex backgrounds. Some scholars have applied the technical results to general fields such as bill documents and medical records, and have balanced the performance and time consumption of text interpretation models by improving feature extraction and feature fusion modules.
[0004] Although with the development of deep learning, the performance of text interpretation methods in general fields has been greatly improved in terms of accuracy and efficiency. However, the number of text categories contained in hydropower engineering documents is huge, and character classification is more complex. At the same time, the Chinese characters in hydropower engineering texts have the characteristics of complex stroke structure and the existence of similar words. The distinction between similar characters in visual features such as stroke contour, connectivity and radical is not obvious, which places higher requirements on the text recognition model to extract character features. These general field technologies still have limitations in hydropower engineering documents with diverse layout scales and complex character categories, which seriously hinders the development and progress of text intelligent processing technology in the water conservancy and hydropower industry.
[0005] Text interpretation is an important part of the field of pattern recognition, which consists of two main tasks: text detection and text recognition. In the text detection task, since the hydropower engineering construction documents contain text areas of different scales such as paragraphs, table names, and footers, the complex and diverse text types require the text detection model to pay more attention to the extraction effect of multi-scale text line features. In the text recognition task, unlike English documents consisting of only 26 Latin letters, the number of text categories contained in the hydropower engineering construction documents is huge, and the character classification is more complex. At the same time, the Chinese characters in the hydropower engineering construction text have the characteristics of complex stroke structure and the existence of similar words. The distinction between similar characters in visual features such as stroke contours, connectivity, and radicals is not obvious, which places higher requirements on the text recognition model to extract character features.
[0006] Although there are relatively mature OCR technologies that can realize the conversion of uncompilable texts, due to the particularity of texts in the hydropower engineering field, the adaptability of existing OCR technologies in this field needs to be improved. In addition, there is currently a lack of a complete set of automatic text conversion devices. For documents such as books, they still need to be manually scanned and then converted using commercial software. The level of automation still needs to be improved. Summary of the invention
[0007] In view of the above problems, the present invention provides a method for vectorizing hydropower engineering document text based on spatial semantic correction to realize the automatic conversion of unstructured text and image data into editable text in hydropower engineering construction. Based on automatic scanning equipment and intelligent algorithms, the non-editable text in paper carriers is efficiently and quickly converted into editable electronic documents, realizing the automatic reuse of non-editable resources in hydropower engineering construction, which helps to greatly improve the data service capabilities in the field of water conservancy and hydropower engineering.
[0008] In order to realize the above technical features, the object of the present invention is achieved as follows: a method for vectorizing and converting hydropower engineering document text based on spatial semantic correction comprises the following steps:
[0009] Step 1: Build an automatic scanning instrument for hydropower engineering construction text:
[0010] This automatic text scanning device automatically turns pages of the hydropower engineering construction text and scans it to form a picture document, and then realizes the automatic conversion of the hydropower engineering construction paper text into picture text through the automatic text scanning device;
[0011] Step 2: Construct a hydropower project construction text interpretation dataset:
[0012] By batch processing the non-editable hydropower project construction text into image format, the unstructured text images in the hydropower project construction documents are further segmented, and the training samples of the text interpretation model are expanded by using data enhancement;
[0013] Step 3: Build a hydropower engineering construction text detection model HC-PSENet, input unstructured text images, extract and fuse text region features, and perform progressive scale expansion post-processing to output text regions containing location information in units of text lines;
[0014] Step 4: Analyze the domain knowledge of hydropower engineering construction documents, and supplement professional terms and special characters to form a professional corpus;
[0015] Step 5: Establish a hydropower engineering construction text recognition model HC-CRNN, input the detected text area, and sequentially go through the processes of extracting text features, predicting text sequences, and mapping text labels to output text information in the form of editable characters;
[0016] Step 6: Introduce a two-stage transfer learning strategy, which does not require a large amount of labeled data and training costs, and applies the learned knowledge or model parameters to related fields, so that the universal model can quickly adapt to personalized needs;
[0017] Step 7, construct a vectorization conversion device for hydropower engineering construction documents, build an information flow between the automatic text scanning instrument and the intelligent algorithm, and pass the scanned image document to the background algorithm after scanning. After text detection and text recognition, a vectorized document is generated and output to the user.
[0018] Step 1 also includes the following steps:
[0019] Step 1-1, document preparation:
[0020] The automatic text scanning device includes a power port and a document inlet. The power port is plugged into a power source, the document inlet is opened, and the paper document to be scanned is placed in the slot, and the document inlet is closed. When the document inlet is closed, the page turning brush will adjust its direction through the page turning shaft so that the page turning brush is close to the document. In order to prevent the page of the perfect-bound document from tilting, a page fixing device is added to fix the document page, thereby completing the preparation work for document scanning.
[0021] Step 1-2, start scanning:
[0022] After clicking the start button, the instrument starts to run. Before starting, select single-sided document or double-sided document by pressing the selection button to adapt to different forms of paper documents. During the scanning process, the side lighting is used to fill in the light during the scanning process. The top scanning camera is used to shoot two pages of the document respectively. The pictures taken and saved will automatically record the order of the pictures. When finally integrated, the files are saved according to the order of the text pages themselves.
[0023] Steps 1-3, automatic page turning:
[0024] Since a paper document may have multiple pages, an automatic page turning component is added to the instrument. After the scanning camera completes a single scan, the sensing device will automatically send a signal, the page fixing device will automatically pop up using the rotating shaft, and the page turning brush will automatically start to operate, rolling up the document page, and using the running device composed of the page turning rotating shaft, sliding rod, and base, the page is spread from right to left to complete the text page turning backwards. After the page turning is completed, the page turning brush will automatically retract to avoid affecting the text scanning. At the same time, when the sensing device senses that the page turning is completed, the page fixing device will automatically drop down to fix the pages at both ends to ensure the flatness of the paper document after the page turning;
[0025] Steps 1-4, scanning completed:
[0026] After steps 1-2 and 1-3 are repeated until all documents are scanned, the scanned image documents are integrated and saved in order and passed to the subsequent text vectorization decomposition algorithm.
[0027] Step 2 also includes the following steps:
[0028] Step 2-1, batch process the non-editable hydropower engineering construction text into image format, and uniformly adjust the resolution to a unified resolution;
[0029] Step 2-2, using the OpenCV toolbox to segment the unstructured text images in the hydropower project construction documents, and constructing a text detection dataset and a text recognition dataset for the hydropower project construction documents;
[0030] In step 2-3, the data enhancement method of Gaussian blur and contrast adjustment is used to expand the training set in the hydropower project construction text interpretation dataset by multiple times, thereby improving the training accuracy of the model while avoiding overfitting of the model.
[0031] Step 3 also includes the following steps:
[0032] Step 3-1, build the PSENet text detection model:
[0033] PSENet is a segmentation-based text detection model. It effectively solves the problem of difficult segmentation of adjacent text instances through a progressive scale expansion algorithm. It also achieves precise positioning of text regions of arbitrary shapes based on pixel-level segmentation. It is suitable for text detection tasks in hydropower engineering construction documents.
[0034] Step 3-2: Construction of feature extraction layer of hydropower engineering construction text detection model:
[0035] The feature extraction layer is based on the PP-HGNet backbone network and is responsible for extracting features at different levels of the image. The input image first passes through the Stem image processing module to improve the model's feature extraction capability without increasing the model parameters. The feature map is then obtained through four groups of convolutional layers Conv Stage 1 to Conv Stage 4. The output feature map sizes are 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original input image size, respectively. The Conv Stage is composed of a large number of standard convolution HG Block modules, and a learnable downsampling layer LDS Layer is introduced to reduce the model parameters and computational complexity.
[0036] Step 3-3, feature fusion construction of hydropower engineering construction text detection model:
[0037] The feature fusion layer is inspired by the feature pyramid network. It combines the shallow position information with the high-level semantic features by top-down and lateral connection methods to obtain four 256-channel feature maps P2~P5. The four feature maps are further fused into a 1024-channel feature map F through formula (1).
[0038] F=P2||Up ×2 (P3)||||Up ×4 (P4)||Up ×8 (P5) (1);
[0039] In the formula: || represents the splicing operation, Up ×2 、Up ×4 、Up ×8 Respectively represent 2, 4, and 8 times upsampling;
[0040] Step 3-4, constructing the feature map of the hydropower project construction text detection model:
[0041] The feature map F is reduced to 256 channels after passing through a 3×3 convolutional layer, a Batchnorm layer, and a ReLu layer, and then passes through n 1×1 convolutional layers, upsampling layers, and Sigmoid layers in sequence to obtain n semantic segmentation results S1~S n , where S1 represents the text instance segmentation result with the smallest kernel, S n represents the original segmentation result with the largest kernel. Finally, the asymptotic expansion algorithm is used to segment S1 to S n Perform scale expansion to obtain the final hydropower engineering construction text detection result R;
[0042] Step 3-5, construction of loss function of hydropower engineering construction text detection model:
[0043] The loss function of the constructed hydropower engineering construction text detection model HC-PSENet considers two aspects: region category and text detection box position. The expression is shown in formula (2);
[0044] L=λL f +(1-λ)L s (2);
[0045] Where: L f represents the loss of the complete text instance, which is used to distinguish text and non-text areas; L s represents the loss of the text kernel instance, which is used to determine the border position of the text area; λ is the balance coefficient;
[0046] Steps 3-6: Construct the hydropower engineering construction text detection model HC-PSENet:
[0047] The PP-HGNet backbone network is introduced into the PSENet model to construct the hydropower engineering construction text detection model HC-PSENet, which enhances the ability of the text detection model to extract multi-scale text line features; the network structure of the hydropower engineering construction text detection model is divided into three parts: feature extraction layer, feature fusion layer and output layer.
[0048] Step 4 also includes the following steps:
[0049] Step 4-1, analyzing the character categories of hydropower engineering construction documents, which are divided into four categories: basic text, professional text, superscript and subscript characters, and special characters; basic text consists of texts widely used in documents in most fields, professional text refers to texts that appear frequently in hydropower engineering construction, and superscript and subscript characters and special characters refer to mathematical variables and chemical terminology characters commonly used in hydropower engineering construction documents;
[0050] Step 4-2, build a professional corpus based on domain knowledge, add basic text, professional text, superscript and subscript characters and special characters to the professional corpus to obtain accurate domain text expression. The professional corpus based on domain knowledge fills the gaps in the original corpus in professional text, power units and special symbols, and enhances the adaptability of the model to hydropower project construction documents.
[0051] Step 5 also includes the following steps:
[0052] Step 5-1, introduce the ResNet network:
[0053] The ResNet network introduces the residual module and uses ResNet-50 as the backbone network of the hydropower engineering construction text recognition model HC-CRNN. The overall network structure is divided into 5 stages, consisting of 49 convolutional layers and 1 fully connected layer;
[0054] Step 5-2, construct the improved loss function C-CTC Loss:
[0055] CTC Loss is a loss function used to process variable-length output sequences. Its formula is shown in formula (3). Center Loss increases the distance between classes and reduces the distance within classes by optimizing the distance between the feature vector and the class center. It can effectively improve the model's ability to distinguish similar samples. The formula is shown in formula (4). Based on this, Center Loss is introduced into CTC Loss to form C-CTC Loss, as shown in formula (5).
[0056] L CTC = -∑logp(l|y) (3);
[0057]
[0058] L C-CTC =L CTC +λL Center (5);
[0059] Step 5-3, construct the hydropower engineering construction text recognition model HC-CRNN based on the improved CRNN:
[0060] The CRNN model mainly consists of three parts: convolutional layer, recurrent layer and transcription layer. The convolutional layer uses a 3×3 convolution kernel to slide the window on the image features to output a series of feature maps of the image and extract the sequence features of the image. The recurrent layer uses the Bi-LSTM model to predict the feature sequence and output the predicted text label information. The transcription layer merges repeated characters and removes blank labels based on CTC Loss to form the final text sequence result. In order to enhance the accuracy of the CRNN model in recognizing characters of hydropower engineering construction text, the ResNet backbone network is introduced into the convolutional layer, and a professional corpus of hydropower engineering construction text is constructed based on domain knowledge as the basis for predicting categories in the recurrent layer. Center Loss is integrated in the transcription layer to improve CTCLoss to achieve accurate recognition of similar characters.
[0061] Step 6 also includes the following steps:
[0062] Step 6-1, apply the parameter-based transfer learning method to the hydropower engineering construction text interpretation model, and achieve migration by finding shared parameter information from the source domain and the target domain to avoid overfitting of the model training under small data sets;
[0063] Step 6-2, for the text detection subtask, the source domain is the ICDAR2015 text detection dataset, and the target domain is the annotated hydropower engineering construction text detection dataset;
[0064] Step 6-3, for the text recognition subtask, the source domain is the MJSynth and SynthText text recognition datasets, and the target domain is the hydropower engineering construction text recognition dataset;
[0065] In step 6-4, for the hydropower engineering construction text detection and text recognition subtasks, the pre-trained models that have been trained in the source domain are selected to initialize the model weights, and the model parameters are further adjusted in the target domain using a fine-tuning strategy. At the same time, since the professional corpus of hydropower engineering construction has been re-established, the output character categories of the fully connected layer of the text recognition model have changed, and the output layer of the text recognition model needs to be retrained.
[0066] Step 7 also includes the following steps:
[0067] Step 7-1, automatic scanning of hydropower project construction paper documents:
[0068] First, the paper document is placed in the text automatic scanning device to realize the conversion of the paper document into the image format, and the converted file is then transmitted to the intelligent algorithm module;
[0069] Step 7-2: vectorization conversion is achieved through text intelligent interpretation algorithm:
[0070] In this step, the image text transmitted from step 7-1 is processed, and after text detection and text recognition, the image document is converted into a vector;
[0071] Step 7-3, vectorized document output:
[0072] In step 7-2, the image document is transformed into vector form. In this step, the vectorized text is sorted in order, and the images and tables are inserted in order. Finally, the text is integrated to achieve vector transformation and output.
[0073] The present invention has the following beneficial effects:
[0074] The present invention proposes a method for vectorizing hydropower engineering document text based on spatial semantic correction to realize the automatic conversion of unstructured text and image data into editable text for hydropower engineering construction. Based on automatic scanning equipment and intelligent algorithms, the non-editable text in paper carriers can be efficiently and quickly converted into editable electronic documents, realizing the automatic reuse of non-editable resources in hydropower engineering construction, which is helpful to greatly improve the data service capabilities in the field of water conservancy and hydropower engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0076] Figure 1 The process of interpreting hydropower project construction texts.
[0077] Figure 2 Automatic scanning equipment for hydropower engineering construction documents.
[0078] Figure 3 Hydropower Engineering Construction Text Interpretation Dataset
[0079] Figure 4 The hydropower engineering construction text detection model HC-PSENet integrated with PP-HGNet.
[0080] Figure 5 A professional corpus of hydropower engineering construction texts based on domain knowledge.
[0081] Figure 6 ResNet-50 network structure.
[0082] Figure 7Hydropower engineering construction text recognition model HC-CRNN based on improved CRNN.
[0083] Figure 8 Visualization effect of hydropower project construction text interpretation model. DETAILED DESCRIPTION
[0084] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.
[0085] Embodiment 1:
[0086] A method for text vectorization conversion of hydropower engineering documents based on spatial semantic correction is proposed. An automatic scanning instrument for hydropower engineering documents is constructed to realize the automatic conversion of paper documents into image formats. A hydropower engineering construction text interpretation dataset and a professional corpus DKPC based on domain knowledge are constructed to obtain the text category and layout background of hydropower engineering construction documents; a text detection model HC-PSENet based on pixel-level segmentation is developed, and the PP-HGNet backbone network is introduced to enhance the feature extraction performance of the model; a text recognition model HC-CRNN based on feature enhancement is established, and the ResNet backbone network and C-CTCLoss are used to enhance the accuracy of the model in recognizing characters; a parameter-based transfer learning strategy is used to train the model to avoid problems such as imbalance between sample classes and overfitting of the model. Finally, an automatic interpretation device for hydropower engineering construction paper documents is formed based on instruments and algorithms to improve the intelligent level of text interpretation.
[0087] Embodiment 2:
[0088] The present invention belongs to the field of intelligent mining of hydropower engineering construction text, and provides a method for vectorizing hydropower engineering document text. The specific steps are as follows, and the overall idea is as follows. Figure 1 .
[0089] Step 1: Build an automatic scanning instrument for hydropower engineering construction text. After automatic page turning and scanning, a picture document is formed. The instrument can realize the automatic conversion of hydropower engineering construction paper text into picture text, such as Figure 2 shown.
[0090] Step 1-1, document preparation. The automatic text scanning device includes a power port m and a document entrance g. The power port m is plugged into a power source, the document entrance g is opened, and the paper document to be scanned is placed in the slot, and the document entrance g is closed. When the document entrance g is closed, the page turning brush c will adjust its direction through the page turning shaft h so that the page turning brush c is close to the document. In order to prevent the page of the perfect-bound document from tilting, the page fixing device d is added to fix the document page, thereby completing the preparation work for document scanning.
[0091] Step 1-2, start scanning. Click the start button n to start the instrument. Before starting, press the button p to select single-sided document or double-sided document to adapt to different forms of paper documents. During the scanning process, the side lights e and f are used to fill in the light during the scanning process. The top scanning cameras a and b are used to shoot two pages of the document respectively. The pictures taken and saved will automatically record the order of the pictures, and the files will be saved in the order of the text pages themselves during the final integration.
[0092] Step 1-3, automatic page turning. Since a paper document may have multiple pages, an automatic page turning component is added to the instrument. After the scanning camera completes a single scan, the sensing device q will automatically send a signal, the page fixing device d will automatically pop up using the rotating shaft l, and the page turning brush c will automatically start to operate, rolling up the document page, and using the operating device composed of the page turning shaft h, the slide bar j, and the base k, the page is spread from right to left to complete the text backward page turning. After the page turning is completed, the page turning brush c will automatically retract to avoid affecting the text scanning. At the same time, when the sensing device q senses that the page turning is completed, the page fixing device d will automatically drop down to fix the pages at both ends to ensure the flatness of the paper document after turning the page.
[0093] Step 1-4, scanning is completed. After steps 1-2 and 1-3 are repeated until all documents are scanned, the scanned image documents are integrated and saved in order and passed to the subsequent text vectorization decoding algorithm.
[0094] Step 2: Construct a hydropower project construction text interpretation dataset. The non-editable hydropower project construction texts are batch processed into image format. Furthermore, the unstructured text images in the hydropower project construction documents are segmented, and the training samples of the text interpretation model are expanded by data enhancement.
[0095] Step 2-1, batch process the non-editable hydropower project construction text into image format with a unified resolution of 300dpi.
[0096] In step 2-2, the OpenCV toolbox is used to segment the unstructured text images in the hydropower project construction documents, and a text detection dataset and a text recognition dataset for the hydropower project construction documents are constructed.
[0097] In step 2-3, data enhancement methods such as Gaussian blur and contrast adjustment are used to expand the training set in the hydropower engineering construction text interpretation dataset by 6 times, thereby improving the training accuracy of the model while avoiding overfitting of the model. Figure 3 shown.
[0098] Step 3: Construct the hydropower engineering construction text detection model HC-PSENet, input the unstructured text image, extract and fuse the text region features, and perform progressive scale expansion post-processing to output the text region containing location information in units of text lines.
[0099] Step 3-1, build the PSENet text detection model. PSENet is a segmentation-based text detection model that effectively solves the problem of difficult segmentation of adjacent text instances through a progressive scale expansion algorithm, and achieves precise positioning of text areas of arbitrary shapes based on pixel-level segmentation, which is suitable for text detection tasks in hydropower engineering construction documents.
[0100] Step 3-2, construct the feature extraction layer of the hydropower engineering construction text detection model. The feature extraction layer is based on the PP-HGNet backbone network and is responsible for extracting features at different levels of the image. The input image first passes through the Stem image processing module, with the aim of improving the model's feature extraction capability without increasing the number of model parameters. Furthermore, feature maps are obtained in turn through four groups of convolutional layers ConvStage 1 to Conv Stage 4, and the output feature map sizes are 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original input image size, respectively. Conv Stage is mainly composed of HG Block modules containing a large number of standard convolutions, and a learnable downsampling layer LDS Layer is introduced to reduce the number of model parameters and the amount of calculation.
[0101] Step 3-3, feature fusion construction of hydropower engineering construction text detection model. The feature fusion layer is inspired by the feature pyramid network. It combines shallow position information with high-level semantic features using a top-down and lateral connection method to obtain four 256-channel feature maps P2~P5. The four feature maps are further fused into a 1024-channel feature map F through formula (1);
[0102] F=P2||Up ×2 (P3)||||Up ×4 (P4)||Up ×8 (P5) (1);
[0103] In the formula: || represents the splicing operation, Up ×2 、Up ×4 、Up ×8 Respectively represent 2, 4, and 8 times upsampling;
[0104] Step 3-4: Construct the feature map of the hydropower engineering construction text detection model. The feature map F is reduced to 256 channels after passing through a 3×3 convolution layer, a Batchnorm layer, and a ReLu layer, and then passes through n 1×1 convolution layers, upsampling layers, and Sigmoid layers in sequence to obtain n semantic segmentation results S1~Sn , where S1 represents the text instance segmentation result with the smallest kernel, S n represents the original segmentation result with the largest kernel. Finally, the asymptotic expansion algorithm is used to segment S1 to S n Perform scale expansion to obtain the final hydropower engineering construction text detection result R;
[0105] Step 3-5, constructing the loss function of the hydropower engineering construction text detection model. The loss function of the hydropower engineering construction text detection model HC-PSENet constructed in this embodiment considers two aspects: region category and text detection box position, and the expression is shown in formula (2);
[0106] L=λL f +(1-λ)L s (2);
[0107] Where: L f represents the loss of the complete text instance, which is used to distinguish text and non-text areas; L s represents the loss of the text kernel instance, which is used to determine the border position of the text area; λ is the balance coefficient, which is set to 0.7 in this embodiment.
[0108] Step 3-6, construct the hydropower engineering construction text detection model HC-PSENet. PSENet is a segmentation-based text detection model, which effectively solves the problem of difficult segmentation of neighboring text instances through a progressive scale expansion algorithm, and realizes precise positioning of text areas of arbitrary shapes based on pixel-level segmentation. It is suitable for text detection tasks in hydropower engineering construction documents. In order to more accurately detect the multi-scale text line position information in hydropower engineering construction documents, the PP-HGNet backbone network is introduced into the PSENet model to construct the hydropower engineering construction text detection model HC-PSENet, which enhances the ability of the text detection model to extract multi-scale text line features. The network structure of the hydropower engineering construction text detection model is divided into three parts: feature extraction layer, feature fusion layer and output layer, as shown in Figure 4 shown.
[0109] Step 4: Analyze the domain knowledge of hydropower engineering construction documents, and supplement professional terms and special characters to form a professional corpus.
[0110] Step 4-1, analyze the character categories of hydropower engineering construction documents, which are divided into four categories: basic text, professional text, superscript and subscript characters, and special characters. Figure 5 As shown in the figure. Basic text consists of texts that are widely used in documents in most fields, while professional text refers to texts that appear frequently in hydropower engineering construction. Superscript and subscript characters and special characters refer to characters such as mathematical variables and chemical terms that are commonly used in hydropower engineering construction documents, such as "C90" etc.
[0111] Step 4-2, build a professional corpus based on domain knowledge. This study adds basic text, professional text, superscript and subscript characters, and special characters to the professional corpus to obtain accurate domain text expression. The professional corpus based on domain knowledge makes up for the gaps in professional text, power units, and special symbols in the original corpus, and enhances the adaptability of the model proposed in this study to hydropower engineering construction documents.
[0112] Step 5: Establish a hydropower project construction text recognition model HC-CRNN, input the detected text area, and go through the processes of extracting text features, predicting text sequences, and mapping text labels in sequence to output text information in the form of editable characters.
[0113] Step 5-1, introduce the ResNet network. The ResNet network solves the problems of gradient vanishing and gradient exploding in deep neural networks by introducing residual modules, and has stronger feature extraction capabilities than VGG16. ResNet-50 is used as the backbone network of the hydropower engineering construction text recognition model HC-CRNN. The overall network structure is divided into 5 stages, consisting of 49 convolutional layers and 1 fully connected layer, such as Figure 6 shown.
[0114] Step 5-2, construct an improved loss function C-CTC Loss. CTC Loss is a loss function used to process variable-length output sequences, and its formula is shown in formula (3). Center Loss increases the distance between classes and reduces the distance within classes by optimizing the distance between the feature vector and the class center, which can effectively improve the model's ability to distinguish similar samples. The formula is shown in formula (4). Therefore, Center Loss is introduced into CTC Loss to form C-CTC Loss, as shown in formula (5).
[0115] L CTC = -∑logp(l|y) (3);
[0116]
[0117] L C-CTC =L CTC +λL Center (5);
[0118] Step 5-3, construct the hydropower engineering construction text recognition model HC-CRNN based on the improved CRNN, as shown in Figure 3As shown in the figure. The CRNN model mainly consists of three parts: convolution layer, recurrent layer and transcription layer. The convolution layer uses a 3×3 convolution kernel to slide a window on the image features to output a series of feature maps of the image and extract the sequence features of the image. The recurrent layer uses the Bi-LSTM model to predict the feature sequence and output the predicted text label information. The transcription layer merges repeated characters and removes blank labels based on CTC Loss to form the final text sequence result. In order to enhance the accuracy of the CRNN model in recognizing characters of hydropower engineering construction text, this study introduces the ResNet backbone network in the convolution layer, constructs a professional corpus of hydropower engineering construction text based on domain knowledge as the basis for the recurrent layer to predict categories, and integrates Center Loss in the transcription layer to improve CTCLoss to achieve accurate recognition of similar characters.
[0119] Step 6: Introduce a two-stage transfer learning strategy. This solves the problem of insufficient text annotation information and weak computing power in the construction of hydropower projects under the background of big data. Instead of requiring a large amount of annotated data and training costs, the learned knowledge or model parameters are applied to other related fields, so that the universal model can quickly adapt to personalized needs.
[0120] Step 6-1, apply the parameter-based transfer learning method to the hydropower engineering construction text interpretation model, and achieve migration by finding shared parameter information from the source domain and the target domain to avoid the problem of overfitting of model training under small data sets.
[0121] In step 6-2, for the text detection subtask, the source domain is the ICDAR2015 text detection dataset, and the target domain is the hydropower engineering construction text detection dataset annotated in this study.
[0122] Step 6-3, for the text recognition subtask, the source domain is the MJSynth and SynthText text recognition datasets, and the target domain is the hydropower engineering construction text recognition dataset.
[0123] Step 6-4, for the hydropower engineering construction text detection and text recognition subtasks, select the pre-trained model that has been trained in the source domain to initialize the model weights, and further use the fine-tuning strategy to adjust the model parameters in the target domain. At the same time, since the hydropower engineering construction professional corpus has been re-established, the output character category of the fully connected layer of the text recognition model has changed, so the output layer of the text recognition model needs to be retrained.
[0124] Step 7: Construct a vectorization conversion device for hydropower engineering construction documents. Build an information flow between the text automatic scanning device and the intelligent algorithm. The scanned image document is scanned and passed to the background algorithm. After text detection and text recognition, the vectorized document is output to the user.
[0125] Step 7-1, automatic scanning of paper documents for hydropower engineering construction. First, put the paper documents into the scanning device to realize the conversion of paper documents into image format. The converted files are then transmitted to the intelligent algorithm module.
[0126] Step 7-2, realize vectorization conversion through text intelligent interpretation algorithm. In this step, the image text transmitted from step 7-1 is processed. After text detection and text recognition, the image document is vectorized.
[0127] Step 7-3, vectorized document output. In step 7-2, the image document is vectorized. In this step, the vectorized text is sorted in order, and the images, tables, etc. are inserted in order. Finally, the text is integrated to realize the vectorization conversion and output.
[0128] Embodiment 3:
[0129] Taking a hydropower project as an example, the superiority of the hydropower project document text vectorization conversion method and device based on spatial semantic correction is verified.
[0130] 1. Dataset construction:
[0131] Based on the above non-editable hydropower construction documents, PPOCRLabel was used to construct a hydropower construction text interpretation dataset, which includes two sub-datasets: text detection and text recognition. The text detection dataset annotated in this study consists of image path and text coordinate information, and locates the text position in units of text lines, with a total of 2547 sets of annotated data. The text recognition dataset mainly focuses on character information, consisting of primitive image path and text line position information, and contains 76,189 characters such as Chinese, English, and special text.
[0132] Based on the transfer learning strategy, the text recognition model modifies the character output category according to the professional corpus, so a large data set is still needed to assist the text recognition model in learning the features of each category of text. Based on the background of hydropower engineering construction documents, this study uses the data synthesis tool Style Text to generate hydropower engineering construction professional text and special character datasets, alleviating the problems of small number of samples in hydropower engineering construction documents and uneven distribution between classes of text interpretation datasets. Furthermore, data enhancement methods such as Gaussian blur and contrast adjustment are used to expand the training set in the hydropower engineering construction text interpretation dataset by 6 times, which improves the training accuracy of the model while avoiding overfitting of the model.
[0133] 2. Evaluation indicators:
[0134] To evaluate the performance of the hydropower engineering construction text interpretation model, it is necessary to consider the matching degree of the detected text box and the accuracy of the recognized characters from the two perspectives of text detection and text recognition. For the text detection task, the Interaction Over Union (IoU) is used as the judgment basis, and the performance of the text detection model is evaluated using indicators such as Precision, Recall, and Harmonic Mean (Hmean). The calculation method of the text detection evaluation indicators is as follows:
[0135]
[0136]
[0137]
[0138]
[0139] Where: area(C) is the area of the detected text box area; area(G) is the area of the standard text box area; TP is the number of standard text boxes that exist and are predicted to be detected; FP is the number of text boxes that do not exist but are predicted to be detected; FN is the number of standard text boxes that exist but are not predicted to be detected.
[0140] The text recognition task needs to consider not only the recognition accuracy of characters, but also the impact of misjudgment, omission and misjudgment of each character on the text line. Therefore, this study uses indicators such as accuracy (Acc) and normalized edit distance (NED) to evaluate the performance of the text recognition model from the perspectives of characters and text lines. The calculation method of text recognition evaluation indicators is as follows:
[0141]
[0142]
[0143] Where: N r is the number of correctly recognized characters; N all is the total number of characters to be recognized; N is the total number of text boxes to be detected; s i Represents the true value of a string; Represents the predicted value of a string; For string s i and The larger value of length; Represents the string s i and The principle is to obtain the edit distance of sequence s i Convert to sequence Minimum number of single-character edits (insertions, deletions, or substitutions) required.
[0144]
[0145] 3. Model construction and result analysis:
[0146] The model experiments involved in this study were all carried out on the same computer device, with the built-in operating system being Windows 10 Professional Edition, the programming language being Python 3.8, and the CPU being CoreTM i5-13600KF, GPU is GeForce RTXTM 4070, using the Paddlepaddle framework to build and test the hydropower engineering construction text interpretation model, and each epoch is trained using a strategy that shuffles the order of the data set. The configuration parameters of the hydropower engineering construction text interpretation model in the training and verification phases are determined based on relevant field literature. The specific parameter information is shown in Table 1.
[0147] Table 1 Configuration parameters of hydropower project construction text interpretation model
[0148]
[0149] HC-PSENet and HC-CRNN were trained for 150 rounds, and each round was validated once. The early stopping strategy was set based on 50 rounds. The models achieved the best validation results at the 44th and 139th rounds, respectively, with validation accuracy rates of 98.08% and 90.63%, respectively. The model with the smallest validation loss value was selected as the best model for testing. The detection precision of HC-PSENet was 97.57%, the detection recall rate was 99.35%, and the harmonic mean was 0.985; the recognition accuracy of HC-CRNN was 90.62%, and the standard edit distance was 0.989.
[0150] In order to intuitively demonstrate the advantages of this research model in interpreting hydropower engineering construction texts, three types of hydropower engineering construction text images are selected to visualize the interpretation effect of this research model on the test images, such as Figure 8 As shown. Among them, Figure 8 (a) consists only of words, Figure 8 (b) contains both text and numbers, Figure 8(c) contains text, numbers and special characters. As can be seen from the figure, the number of text lines detected by HC-PSENet and the predicted outer contours of the text lines are basically consistent with the actual annotation information, showing the adaptability of the detection model in this study to hydropower engineering construction documents. The HC-CRNN model can correctly recognize most of the text, numbers and special characters, and the text order is output according to the normal document reading order, indicating that the recognition model in this study has good performance in distinguishing and classifying characters.
[0151] 4. Ablation experiment results:
[0152] In order to verify the effectiveness of the improvement strategy of the hydropower engineering construction text interpretation model, the same training and testing conditions as those in Table 1 are set. The model ablation experiment is carried out by controlling the variables of the improved module. The indicators in Formula (7) to Formula (11) are used to evaluate the influence of each improvement strategy on the model accuracy. The ablation experiment results of the hydropower engineering construction text detection model and text recognition model are shown in Tables 2 and 3, respectively.
[0153] Table 2 HC-PSENet ablation experiment results
[0154]
[0155] Table 3 HC-CRNN ablation experiment results
[0156]
[0157] Note: "√" indicates that the module is added to the model, and "-" indicates that this operation is not performed.
[0158] Table 2 shows the impact of adopting the transfer learning strategy and introducing the PP-HGNet backbone network on the performance of the PSENet model in detecting hydropower engineering construction text. Experiment 1 is the test result of the benchmark model PSENet, and Experiments 2 and 3 respectively verify the impact of transfer learning and PP-HGNet on the performance of the benchmark model. Comparing Experiment 1 with Experiment 2, it can be seen that the introduction of the transfer learning strategy in the benchmark model improves the model accuracy by 4.12%, which verifies that transfer learning can effectively improve the benchmark model's ability to detect hydropower engineering construction text lines. The results of Experiment 3 show that compared with the original backbone network MobileNetV3, PP-HGNet has stronger feature extraction capabilities and can obtain richer text location information in the feature map. Experiment 4 is the test result of HC-PSENet introducing the transfer learning strategy. It can be seen from the table that the model accuracy is increased to 97.57% under the transfer learning strategy, and Hmean reaches 0.985, indicating that the HC-PSENet proposed in this study has better comprehensive performance in the hydropower engineering construction text detection task.
[0159] In order to quantify the effect of transfer learning strategy, professional corpus, ResNet backbone network and C-CTC Loss on the performance of CRNN model in recognizing hydropower engineering construction text, this study designed 9 groups of experiments to verify the impact of various improvement measures on the model recognition accuracy, as shown in Table 3. The accuracy of the baseline model in Experiment 5 in recognizing hydropower engineering construction text was only 1.95%, while the accuracy of the baseline model after the introduction of transfer learning reached 76.17%, indicating that the model was overfitting when transfer learning was not introduced, verifying the importance of transfer learning strategy for complex multi-classification tasks under small sample data sets. Experiments 7-9 respectively verified the impact of professional corpus, ResNet network and C-CTC Loss on the baseline model. The results show that each improvement measure can effectively improve the accuracy of CRNN model in recognizing characters. Among them, the introduction of ResNet backbone network improves the recognition accuracy of the model most significantly, reflecting the importance of the model's ability to extract character features for distinguishing and classifying characters in text recognition tasks. The improvements of professional corpus and C-CTC Loss increased the recognition accuracy of the baseline model by 1.61% and 2.35%, respectively, proving that the increase of corpus text categories and the improvement of loss function can effectively improve network performance in terms of character classification. Overall, with the support of various improvement measures, the accuracy of HC-CRNN (Experiment 13) in recognizing characters is 90.62%, and the standard edit distance reaches 0.989, which can well achieve accurate interpretation of hydropower engineering construction texts.
[0160] 5. Multi-model performance comparison:
[0161] In order to further verify the superiority of the method proposed in this study, the hydropower engineering construction text interpretation dataset constructed in this study was taken as an example, and the same configuration parameters as the hydropower engineering construction text interpretation model were used to select 4 mainstream text detection models and 4 typical text recognition models for comparison. Formula (7)-Formula (11) were used as evaluation indicators, and the test results of each model are shown in Tables 4 and 5.
[0162] Table 4 Comparison results of text detection models
[0163]
[0164] Table 5 Comparison results of text recognition models
[0165]
[0166] Table 4 shows the performance of various typical text detection models in the hydropower engineering construction text interpretation test set. Among them, the harmonic mean of HC-PSENet reaches 0.985, which is better than the other four methods in terms of comprehensive performance of text detection. As can be seen from Table 5, the accuracy and standard edit distance of HC-CRNN are significantly better than the other four recognition methods, indicating that it is more suitable for the character recognition task of hydropower engineering construction text.
[0167] 6. Text intelligent conversion device:
[0168] First, put the paper document into the scanning device to realize the conversion of paper document into image format. The converted file is then transmitted to the intelligent algorithm module. After text detection and text recognition, the vectorization conversion of the image document is realized. In this step, the vectorized text is sorted in order, and the pictures, tables, etc. are inserted in order. Finally, the text is integrated to realize the vectorization conversion and output.
Claims
1. A method for vectorizing hydropower engineering document text based on spatial semantic correction, characterized in that: The following steps are involved: Step 1: Build an automatic scanning instrument for hydropower project construction text: This automatic text scanning device automatically turns pages of hydropower project construction documents and scans them to form image documents, thereby realizing the automatic conversion of hydropower project construction paper documents into image documents. Step 2: Construct a hydropower project construction text interpretation dataset: By batch processing non-editable hydropower project construction documents into image format, we further segmented the unstructured text images in hydropower project construction documents and used data augmentation to expand the training samples of the text interpretation model. Step 3: Build a hydropower project construction text detection model HC-PSENet. Input an unstructured text image and perform post-processing on text region features, including feature extraction, fusion, and progressive scaling. Output the text region containing location information in units of text lines. Step 4: Analyze the domain knowledge of hydropower project construction documents and supplement professional terms and special characters to form a professional corpus; Step 5: Build a hydropower project construction text recognition model HC-CRNN. Input the detected text area, and then go through the process of extracting text features, predicting text sequences, and mapping text labels to output the text information in the form of editable characters. Step 6: Introducing a two-stage transfer learning strategy. This strategy applies the learned knowledge or model parameters to related fields without requiring large amounts of labeled data and training costs, enabling the universal model to quickly adapt to personalized needs. Step 7: Build a vectorization conversion device for hydropower engineering construction documents, establish an information flow between the automatic text scanning instrument and the intelligent algorithm, and pass the scanned image document to the background algorithm after scanning. After text detection and text recognition, the vectorized document is output to the user.
2. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 1 also includes the following steps: Step 1-1, document preparation: The automatic text scanning device includes a power port (m) and a document inlet (g). Plug in the power port (m), open the document inlet (g), place the paper document to be scanned into the slot, and close the document inlet (g). When the document inlet (g) is closed, the page turning brush (c) adjusts its direction through the page turning shaft (h) so that the page turning brush (c) is in close contact with the document. To prevent the pages of the bound document from tilting, a page fixing device (d) is added to fix the document pages, thereby completing the preparation for document scanning. Step 1-2, start scanning: After clicking the start button (n), the instrument starts to operate. Before starting, press the selection button (p) to select single-sided document or double-sided document to adapt to different forms of paper documents. During the scanning process, the side lights (e, f) are used to fill the scanning process with light. The top scanning camera (a, b) takes pictures of two pages of the document respectively. The pictures taken and saved will automatically record the picture order. When finally integrated, the file will be saved according to the order of the text pages itself. Steps 1-3, automatic page turning: Since a paper document may have multiple pages, an automatic page turning component is added to the instrument. After the scanning camera completes a single scan, the sensing device (q) will automatically send a signal, the page fixing device (d) will automatically pop up using the rotating shaft (l), and the page turning brush (c) will automatically start to operate, rolling up the document page. The running device composed of the page turning shaft (h), the slide bar (j), and the base (k) will spread the page from right to left to complete the text page turning backward. After the page turning is completed, the page turning brush (c) will automatically retract to avoid affecting the text scanning. At the same time, when the sensing device (q) senses that the page turning is completed, the page fixing device (d) will automatically drop down to fix the pages at both ends to ensure that the paper document is flat after turning. Steps 1-4, scanning completed: After steps 1-2 and 1-3 are repeated until all documents are scanned, the scanned image documents are integrated and saved in order and passed into the subsequent text vectorization decomposition algorithm.
3. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 2 also includes the following steps: Step 2-1: Batch process the non-editable hydropower project construction text into image format and adjust the resolution to a unified resolution; Step 2-2: Use the OpenCV toolbox to segment the unstructured text images in the hydropower project construction documents and construct a text detection dataset and a text recognition dataset for hydropower project construction documents; In steps 2-3, the data enhancement method of Gaussian blur and contrast adjustment is used to expand the training set in the hydropower project construction text interpretation dataset by several times, thereby improving the training accuracy of the model while avoiding model overfitting.
4. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 3 also includes the following steps: Step 3-1, build the PSENet text detection model: PSENet is a segmentation-based text detection model that effectively solves the problem of difficult segmentation of adjacent text instances through a progressive scale expansion algorithm. It also achieves precise positioning of text regions of arbitrary shapes based on pixel-level segmentation. It is suitable for text detection tasks in hydropower engineering construction documents. Step 3-2: Constructing the feature extraction layer of the hydropower project construction text detection model: The feature extraction layer, based on the PP-HGNet backbone network, is responsible for extracting features at different levels of the image. The input image first passes through the Stem image processing module, which improves the model's feature extraction capabilities without increasing the number of model parameters. Feature maps are then obtained through four sets of convolutional layers, Conv Stage 1 to Conv Stage 4, with the output feature maps being 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original input image size, respectively. The Conv Stage consists of HG Block modules containing a large number of standard convolutions, and a learnable downsampling layer, LDS Layer, is introduced to reduce the number of model parameters and computational complexity. Step 3-3: Feature fusion construction of hydropower project construction text detection model: The feature fusion layer is inspired by the feature pyramid network and combines shallow position information with high-level semantic features using a top-down and lateral connection method to obtain four 256-channel feature maps P2~P5. The four feature maps are further fused into a 1024-channel feature map F through formula (1). F=P2||Up ×2 (P3)||||Up ×4 (P4)||Up ×8 (P5) (1); In the formula: || represents the splicing operation, Up ×2 、Up ×4 、Up ×8 Respectively represent 2, 4, and 8 times upsampling; Step 3-4: Constructing the feature map of the hydropower project construction text detection model: The feature map F is reduced to 256 channels after passing through a 3×3 convolution layer, a Batchnorm layer, and a ReLu layer, and then passes through n 1×1 convolution layers, upsampling layers, and Sigmoid layers in sequence to obtain n semantic segmentation results S1~S n , where S1 represents the text instance segmentation result with the smallest kernel, S n Represents the original segmentation result with the largest kernel. Finally, the asymptotic expansion algorithm is used to sequentially segment S1 to S n Perform scale expansion to obtain the final hydropower engineering construction text detection result R; Steps 3-5: Construction of loss function for hydropower engineering construction text detection model: The loss function of the constructed hydropower engineering construction text detection model HC-PSENet considers two aspects: region category and text detection box position. The expression is shown in formula (2); L=λL f +(1-λ)L s (2); Where: L f represents the loss of the complete text instance, which is used to distinguish text and non-text areas; L s represents the loss of the text kernel instance, which is used to determine the bounding box position of the text area; λ is the balance coefficient; Steps 3-6: Build the hydropower engineering construction text detection model HC-PSENet: The PP-HGNet backbone network is introduced into the PSENet model to construct the hydropower engineering construction text detection model HC-PSENet, which enhances the ability of the text detection model to extract multi-scale text line features; the network structure of the hydropower engineering construction text detection model is divided into three parts: feature extraction layer, feature fusion layer and output layer.
5. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 4 also includes the following steps: Step 4-1: Analyze the character categories of hydropower project construction documents, which are divided into four categories: basic text, specialized text, superscript and subscript characters, and special characters. Basic text consists of text that is widely used in documents in most fields. Specialized text refers to text that appears frequently in hydropower project construction. Superscript and subscript characters and special characters refer to characters commonly used in hydropower project construction documents such as mathematical variables and chemical terms. Step 4-2: Build a professional corpus based on domain knowledge. Add basic text, professional text, superscript and subscript characters, and special characters to the professional corpus to obtain accurate domain text expression. The professional corpus based on domain knowledge fills the gaps in the original corpus in professional text, power units, and special symbols, and enhances the adaptability of the model to hydropower project construction documents.
6. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 5 also includes the following steps: Step 5-1, introduce the ResNet network: The ResNet network introduces a residual module and uses ResNet-50 as the backbone network of the hydropower project construction text recognition model HC-CRNN. The overall network structure is divided into five stages, consisting of 49 convolutional layers and one fully connected layer. Step 5-2, construct the improved loss function C-CTC Loss: CTC Loss is a loss function used to process variable-length output sequences. Its formula is shown in formula (3). CenterLoss increases the inter-class distance and reduces the intra-class distance by optimizing the distance between the feature vector and the class center, which can effectively improve the model's ability to distinguish similar samples. The formula is shown in formula (4). Based on this, Center Loss is introduced into CTC Loss to form C-CTC Loss, as shown in formula (5). L CTC =-∑logp(l|y) (3); THE C-CTC =L CTC +λL Center (5); Step 5-3: Build the hydropower project construction text recognition model HC-CRNN based on the improved CRNN: The CRNN model mainly consists of three parts: convolutional layer, recurrent layer and transcription layer. The convolutional layer uses a 3×3 convolution kernel to slide a window on the image features to output a series of feature maps of the image and extract the sequence features of the image. The recurrent layer uses the Bi-LSTM model to predict the feature sequence and output the predicted text label information. The transcription layer merges repeated characters and removes blank labels based on CTC Loss to form the final text sequence result. In order to enhance the accuracy of the CRNN model in recognizing characters in hydropower engineering construction text, a ResNet backbone network is introduced into the convolutional layer, and a professional corpus of hydropower engineering construction text is constructed based on domain knowledge as the basis for the recurrent layer to predict categories. Center Loss is integrated into the transcription layer to improve CTCLoss to achieve accurate recognition of similar characters.
7. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 6 also includes the following steps: Step 6-1: Apply parameter-based transfer learning to the hydropower engineering construction text interpretation model. This method achieves transfer by finding shared parameter information from the source and target domains, thus avoiding overfitting of the model training in small datasets. Step 6-2: For the text detection subtask, the source domain is the ICDAR2015 text detection dataset, and the target domain is the annotated hydropower project construction text detection dataset; Step 6-3: For the text recognition subtask, the source domain is the MJSynth and SynthText text recognition datasets, and the target domain is the hydropower engineering construction text recognition dataset; In step 6-4, for the hydropower engineering construction text detection and text recognition subtasks, the pre-trained models that have been trained in the source domain are selected to initialize the model weights, and the model parameters are further adjusted in the target domain using a fine-tuning strategy. At the same time, since the professional corpus of hydropower engineering construction has been re-established, the output character categories of the fully connected layer of the text recognition model have changed, and the output layer of the text recognition model needs to be retrained.
8. The method for vectorizing hydropower engineering document text based on spatial semantic correction according to claim 1 is characterized in that: Step 7 also includes the following steps: Step 7-1: Automatic scanning of hydropower project construction paper documents: First, the paper document is placed in the text automatic scanning device to realize the conversion of the paper document into image format, and the converted file is then transmitted to the intelligent algorithm module; Step 7-2: Implement vectorization conversion through text intelligent interpretation algorithm: In this step, the image-based text transmitted from step 7-1 is processed and vectorized after text detection and text recognition. Step 7-3, vectorized document output: In step 7-2, the image document is converted into vectors. In this step, the vectorized text is sorted in order, and the images and tables are inserted in order. Finally, the text is integrated to realize the vectorization conversion and output.
Citation Information
Patent Citations
Automatic text generating method based on LSTM-type RNN model
CN108427665A
Text detection and recognition method and system and computer equipment
CN111401371A
Character vectorization method for engineering drawing
CN116884013A
Scene text detection method and system based on sequential deformation
US20220058420A1
Automatic document generation and segmentation system
US20220229969A1
Cited By
Contract document translation method and system based on large model
CN120509421A
A contract document translation method and system based on large model
CN120509421B
