Inventory item optical character recognition method and apparatus

By using a multi-layer network model to identify table areas, text direction, and character position in CAD drawings, the problem of low accuracy in equipment list text recognition is solved, achieving higher recognition accuracy.

CN116704511BActive Publication Date: 2026-05-26GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
Filing Date
2023-05-31
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing methods for recognizing equipment list text in CAD drawings suffer from low recognition accuracy.

Method used

A multi-layer network model is used for equipment list text recognition, including a table detection and reconstruction model, a text direction detection model, a text detection model, and a text recognition model. Through multiple detection models, different types of information in CAD drawings are identified and processed to output equipment list text.

Benefits of technology

It improves the recognition accuracy of equipment list text, significantly enhancing the recognition effect compared to traditional manual interaction methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116704511B_ABST
    Figure CN116704511B_ABST
Patent Text Reader

Abstract

This application relates to a method and apparatus for recognizing equipment list text. The method involves a table detection and reconstruction model that outputs a table area image based on the power distribution network engineering drawing to be recognized; a text direction detection model that outputs text area boundary information based on the table area image; a text detection model that outputs a character area image based on the text area boundary information; and a character recognition model that outputs the corresponding equipment list text from the drawing based on the character area image. Compared to traditional methods of manually recognizing equipment list text, this solution uses multiple detection models to detect different types of information in the power distribution network engineering drawing and obtains the equipment list text from the drawing, thus improving the accuracy of equipment list text recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power engineering technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for recognizing text in an equipment list. Background Technology

[0002] With the application of CAD (Computer-Aided Design), CAD has gradually played an irreplaceable and important role in power engineering design. It not only improves design quality and shortens the design cycle, but also creates significant economic and social benefits. Power engineering design requires the accurate extraction of content from CAD drawings, such as equipment lists. Currently, this extraction is usually done manually; however, manually identifying equipment lists is prone to errors or misidentifications.

[0003] Therefore, current methods for recognizing equipment list text in CAD drawings suffer from low recognition accuracy. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for recognizing device list text that can improve recognition accuracy in response to the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for recognizing text in an equipment list, the method comprising:

[0006] Obtain the drawings of the distribution network project to be identified; the drawings of the distribution network project to be identified include an equipment list;

[0007] The power distribution network engineering drawing to be identified is input into the trained table detection and table reconstruction model to obtain the table area image in the power distribution network engineering drawing to be identified, which is output by the table detection and table reconstruction model based on a multi-layer network.

[0008] The table region image is input into a trained text direction detection model to obtain the text direction detection model. The text direction detection model outputs text region boundary information in the table region image based on spatial and channel dimensions. The text region boundary information represents the boundary information of the regions containing text in the table region image.

[0009] A table region image carrying text region boundary information is input into a trained text detection model to obtain a character region image output by the text detection model after recognizing character positions and character connection information based on the text region boundary information; the character region image represents the image of the region where each character is located in the table region image;

[0010] The character region image is input into a trained text recognition model to obtain the text information output by the text recognition model based on the character region image, and the equipment list text corresponding to the equipment list in the power distribution network engineering drawing to be recognized is determined according to the text information.

[0011] In one embodiment, inputting the power distribution network engineering drawing to be identified into the trained table detection and table reconstruction model includes:

[0012] The power distribution network engineering drawing to be identified is input into the trained table detection and table reconstruction model. The table detection and table reconstruction model extracts the equipment list features in the power distribution network engineering drawing to be identified. The equipment list features are then subjected to convolution operation to obtain the two-dimensional convolution data corresponding to the equipment list features.

[0013] The two-dimensional convolutional data is normalized, and then smoothed before the table area image in the power distribution network engineering drawing to be identified is output.

[0014] In one embodiment, inputting the table region image into a trained text direction detection model includes:

[0015] The table region image is input into a trained text direction detection model, which then extracts the global feature map, multiple height channel feature maps, and multiple width channel feature maps corresponding to the table region image.

[0016] Based on the channel attention mechanism, the multiple height channel feature maps and the multiple width channel feature maps are merged to obtain a height channel feature map carrying spatial information and a width channel feature map carrying spatial information.

[0017] Based on the spatial attention mechanism, the height channel feature map carrying spatial information and the width channel feature map carrying spatial information are modeled respectively to obtain the modeled height feature map and the modeled width feature map.

[0018] The modeled height feature map, the modeled width feature map, and the global feature map are merged to obtain a merged feature map. The text region boundary information is identified and output based on the merged feature map.

[0019] In one embodiment, inputting the table region image carrying text region boundary information into the trained text detection model includes:

[0020] A table region image carrying text region boundary information is input into a trained text detection model, which then extracts the text region boundary features corresponding to the table region image based on the text region boundary information in the network layer.

[0021] The text region boundary features are input into the convolutional layer of the text detection model. The first branch of the convolutional layer identifies the character position based on the text region boundary features, and the second branch of the convolutional layer identifies the character connection information based on the text region boundary features.

[0022] The character position and character connection information are combined to obtain and output a character region image.

[0023] In one embodiment, inputting the character region image into a trained character recognition model includes:

[0024] The character region image is input into a trained character recognition model, which extracts the character region features of the character region image in a convolutional layer.

[0025] The character region features are input into the recurrent layer of the character recognition model, and the character sequence features corresponding to the character region features are identified in the recurrent layer based on the attention mechanism.

[0026] The character sequence features are input into the transcription layer of the character recognition model. In the transcription layer, the character sequence corresponding to the character sequence features is identified based on the normalized exponential function, and the corresponding text information is output according to the character sequence.

[0027] In one embodiment, the method further includes:

[0028] Obtain a power distribution network engineering drawing sample; the power distribution network engineering drawing sample includes a table area image sample and a text area boundary information sample corresponding to the table area image sample;

[0029] The image sample of the table region is input into the text direction detection model to be trained, and the predicted information of the text region boundary information output by the text direction detection model to be trained is obtained.

[0030] The predicted information of the text region boundary information and the text region boundary information samples are input into a first loss function. The first loss function adjusts the model parameters of the text direction detection model to be trained based on the ratio of the intersection and union of the predicted information of the text region boundary information and the text region boundary information samples, until the first preset training termination condition is met, and the trained text direction detection model is obtained.

[0031] In one embodiment, the method further includes:

[0032] Obtain a power distribution network engineering drawing sample; the power distribution network engineering drawing sample includes a text area boundary information sample and a character area image sample corresponding to the text area boundary information sample.

[0033] Input the text region boundary information sample into the text detection model to be trained, and obtain the character region image prediction information output by the text detection model to be trained;

[0034] Obtain the Gaussian heatmap feature map corresponding to the character region image prediction information. Adjust the model parameters of the text detection model to be trained based on the similarity between the Gaussian heatmap feature map and the character region image sample until the second preset training termination condition is met, and obtain the trained text detection model.

[0035] In one embodiment, the method further includes:

[0036] Obtain a power distribution network engineering drawing sample; the power distribution network engineering drawing sample includes a character area image sample and a text information sample corresponding to the character area image sample;

[0037] The text information sample is input into the text recognition model to be trained, and the predicted information of the text information output by the text recognition model to be trained is obtained.

[0038] The predicted information of multiple text information and multiple text information samples are input into a second preset loss function. Based on the recognition probability of the predicted information of the target text information, the model parameters of the text recognition model to be trained are adjusted by the second preset loss function until a third preset training termination condition is met, and a trained text recognition model is obtained. The predicted information of the target text information represents the predicted information of the text information whose similarity with the multiple text information samples is greater than a preset similarity threshold among the predicted information of the multiple text information.

[0039] In one embodiment, obtaining the power distribution network engineering drawing sample includes:

[0040] Obtain original power distribution network engineering drawings samples;

[0041] The brightness and / or text direction of the power distribution network engineering drawing sample are adjusted respectively to obtain the data-expanded power distribution network engineering drawing sample.

[0042] Secondly, this application provides a device for recognizing text in an equipment list, the device comprising:

[0043] The acquisition module is used to acquire the power distribution network engineering drawings to be identified; the power distribution network engineering drawings to be identified include an equipment list.

[0044] The first identification module is used to input the power distribution network engineering drawing to be identified into a trained table detection and table reconstruction model, and obtain the table area image in the power distribution network engineering drawing to be identified by the table detection and table reconstruction model based on a multi-layer network.

[0045] The second recognition module is used to input the table region image into a trained text direction detection model, obtain the text direction detection model, and obtain the text region boundary information in the table region image output by the text direction detection model based on the spatial dimension and the channel dimension; the text region boundary information represents the boundary information of the region where text exists in the table region image;

[0046] The third recognition module is used to input a table region image carrying text region boundary information into a trained text detection model, and obtain a character region image output by the text detection model after recognizing character positions and character connection information based on the text region boundary information; the character region image represents the image of the region where each character is located in the table region image;

[0047] The fourth recognition module is used to input the character region image into a trained text recognition model, obtain the text information output by the text recognition model based on the character region image, and determine the equipment list text corresponding to the equipment list in the power distribution network engineering drawing to be recognized based on the text information.

[0048] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0049] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0050] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0051] The aforementioned equipment list text recognition method, apparatus, computer equipment, storage medium, and computer program product, through a table detection and reconstruction model outputting a table area image based on the power distribution network engineering drawing to be recognized, a text direction detection model outputting text area boundary information based on the table area image, a text detection model outputting a character area image based on the text area boundary information, and a text recognition model outputting the equipment list text corresponding to the equipment list in the drawing based on the character area image. Compared to the traditional method of recognizing equipment list text through manual interaction, this solution improves the accuracy of equipment list text recognition by detecting different types of information in the power distribution network engineering drawing through multiple detection models and obtaining the equipment list text in the drawing. Attached Figure Description

[0052] Figure 1 This is a flowchart illustrating a method for recognizing text in a device list in one embodiment;

[0053] Figure 2 This is a schematic diagram of the device list text in one embodiment;

[0054] Figure 3 This is a schematic diagram illustrating the steps of training a text direction detection model in one embodiment;

[0055] Figure 4 This is a flowchart illustrating the text region boundary information recognition step in one embodiment;

[0056] Figure 5 This is a flowchart illustrating the character region image recognition steps in one embodiment;

[0057] Figure 6 This is a schematic diagram of the structure of a text detection model in one embodiment;

[0058] Figure 7 This is a schematic diagram of the structure of a text recognition model in one embodiment;

[0059] Figure 8 This is a flowchart illustrating the device list text recognition method in another embodiment;

[0060] Figure 9 This is a structural block diagram of a device list text recognition device in one embodiment;

[0061] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0063] In one embodiment, such as Figure 1 As shown, a method for recognizing text in a device list is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, or to a system including both a terminal and a server, and is implemented through the interaction between the terminal and the server. The method includes the following steps:

[0064] Step S202: Obtain the power distribution network engineering drawings to be identified; the power distribution network engineering drawings to be identified include an equipment list.

[0065] The distribution network engineering drawing to be identified can be an engineering drawing of a 20kV or lower distribution network project. This drawing may include an equipment list, and the terminal needs to recognize the text in the equipment list within the drawing. Therefore, the terminal can first obtain the distribution network engineering drawing to be identified. Specifically, it can obtain engineering drawings of 20kV or lower distribution networks as the drawing to be identified.

[0066] In one embodiment, the terminal can also pre-train multiple models, such as a table detection and reconstruction model, a text direction detection model, a text detection model, and a text recognition model. This allows the terminal to recognize different types of information on the power distribution network engineering drawings to be identified based on the trained models. When training each model, the terminal needs to pre-build samples. Since the amount of data in power distribution network engineering drawings is limited due to their multi-directional nature, sample acquisition requires data augmentation. For example, in one embodiment, the terminal can acquire original power distribution network engineering drawing samples; then, it can adjust the brightness and / or text direction of these samples to obtain augmented power distribution network engineering drawing samples.

[0067] Specifically, the aforementioned power distribution network engineering drawings to be identified can be CAD drawings of equipment lists for 20KV and below power distribution networks. The terminal can collect a dataset of CAD drawings of equipment lists for 20KV and below power distribution networks. Since the amount of data in these CAD drawings is limited in many directions, the terminal can augment the collected dataset using brightness adjustments such as increasing or decreasing image brightness, and data augmentation algorithms such as adding text direction enhancements. Finally, the terminal can divide the dataset into a training set, a validation set, and a test set. The training set includes power distribution network engineering drawing samples, and the validation set includes the corresponding recognition result samples. Because different models produce different outputs, the data in the training and validation sets will differ for different models. The terminal can use the open-source software labelImg as a training set sample annotation tool to annotate the data, thereby obtaining sample information that can be used for validation.

[0068] Step S204: Input the power distribution network engineering drawing to be identified into the trained table detection and table reconstruction model, and obtain the table area image in the power distribution network engineering drawing to be identified from the output of the table detection and table reconstruction model based on the multi-layer network.

[0069] The terminal can pre-train a table detection and reconstruction model. For example, the terminal can pre-acquire a sample of the power distribution network engineering drawing to be identified, as well as corresponding table area image samples. The terminal inputs the sample of the power distribution network engineering drawing to be identified into the table detection and reconstruction model to be trained, obtains the table area image prediction information output by the table detection and reconstruction model, and inputs the table area image prediction information and the table area image samples into a preset loss function. Based on the output value of the loss function, the model parameters of the table detection and reconstruction model to be trained are adjusted until a preset training termination condition is met. For example, within a preset number of training iterations, the output value of the loss function meets a preset threshold, or the number of training iterations reaches a preset number of training iterations, thus obtaining the trained table detection and reconstruction model. Specifically, the preset loss function can be a sigmoid loss function, and the output range of the table detection and reconstruction model can be between 0 and 1.

[0070] After obtaining the trained table detection and reconstruction model, the terminal can input the power distribution network engineering drawing to be identified into the model. The model then identifies the table area images in the drawing based on a multi-layer network and outputs the identified table area images, thus allowing the terminal to obtain the table area images from the power distribution network engineering drawing. Specifically, the table area images can include the table structure in the power distribution network engineering drawing. The terminal can use the table detection and reconstruction model to identify information such as the table outline, table lines, and table structure in the drawing, obtaining the distribution of rows and columns and the logical structure between cells, thereby achieving table document reconstruction.

[0071] Step S206: Input the table region image into the trained text direction detection model, obtain the text direction detection model, and obtain the text region boundary information in the table region image output by the text direction detection model based on the spatial dimension and channel dimension; the text region boundary information represents the boundary information of the region containing text in the table region image.

[0072] Text orientation detection, based on object detection, identifies various orientations of text. Object detection aims to find all objects of interest in an image, determine their category and location, and is one of the core problems in computer vision. Due to the different appearances, shapes, and poses of various objects, coupled with interference from factors such as lighting and occlusion during imaging, object detection remains one of the most challenging problems in computer vision. The terminal can pre-train a text orientation detection model. For example, the terminal trains a text orientation detection model based on table region image samples and corresponding text region boundary information samples, resulting in a trained text orientation detection model. This model can then be used to identify various orientations of text in the aforementioned table region image and determine the boundary information of text regions belonging to the same orientation, serving as the text region boundary information.

[0073] The terminal can input the identified table region image into a trained text direction detection model. The model, based on spatial and channel dimensions, identifies the text region boundary information in the table region image and outputs the corresponding text region boundary information. This text region boundary information represents the boundary information of regions containing text in the table region image, such as the boundaries of regions containing text belonging to the same direction.

[0074] Step S208: Input the table region image carrying text region boundary information into the trained text detection model to obtain the character region image output by the text detection model after recognizing character positions and character connection information based on the text region boundary information; the character region image represents the image of the region where each character is located in the table region image.

[0075] The terminal can pre-train a text detection model. For example, the terminal trains a text detection model based on table region image samples carrying text region boundary information and corresponding character region image samples, resulting in a trained text detection model. This text detection model can then be used to identify the regions containing each character in the aforementioned table region image.

[0076] The terminal can input the table region image carrying the text region boundary information into a trained text detection model. The text detection model identifies character positions and character connection information based on the text region boundary information and outputs the character region image corresponding to the text region boundary information. That is, the character region image contains character positions and character connection information. The character position indicates the location of each character in the table, and the character connection information indicates the connection between adjacent characters. The character region can be determined based on the center pixel of each character, and the character connection information can be determined based on the character gaps between characters. It should be noted that the table region image within the text region boundary can include multiple characters, thus the terminal can use the text detection model to identify each character region image within the corresponding table region based on the text region boundary information.

[0077] Step S210: Input the character region image into the trained text recognition model, obtain the text information output by the text recognition model based on the character region image, and determine the equipment list text corresponding to the equipment list in the power distribution network engineering drawing to be recognized based on the text information.

[0078] The terminal can pre-train a text detection model. For example, based on character region image samples and corresponding text information samples, the terminal trains a text recognition model to be trained, resulting in a trained text recognition model. This model can then be used to recognize the text corresponding to the aforementioned character region images; this text could be the text from the equipment list in the aforementioned power distribution network engineering drawings.

[0079] The terminal can input the aforementioned character region image into a trained text recognition model. The model then identifies the text information within the character region image and outputs the corresponding text information, such as the text information in the character region image of an equipment list. Thus, the terminal can determine the corresponding equipment list text in the power distribution network engineering drawing based on the text information.

[0080] Specifically, such as Figure 2 As shown, Figure 2 This is a schematic diagram of the equipment list text in one embodiment. The terminal can obtain CAD drawings of equipment lists for 20KV and below distribution network projects as the distribution network project drawings to be identified. The terminal inputs the aforementioned CAD drawings of the 20KV and below distribution network project equipment list into the aforementioned table detection and table reconstruction model. Using this model, along with a text direction detection model, a text detection model, and a text recognition model, the terminal performs text recognition on the equipment list in the drawing to obtain the text information of the equipment list. Furthermore, the terminal can automatically create a new table based on the recognized equipment list text and display the corresponding equipment list text information. For example, Figure 2Table 300 can be a CAD drawing of the equipment list for 20KV and below distribution network projects, and Table 302 can be the equipment list text in the drawing identified by the terminal through the above models.

[0081] In the aforementioned equipment list text recognition method, a table detection and reconstruction model outputs a table area image based on the power distribution network engineering drawing to be recognized. A text direction detection model outputs text area boundary information based on the table area image. A text detection model outputs a character area image based on the text area boundary information. Finally, a text recognition model outputs the corresponding equipment list text from the drawing based on the character area image. Compared to the traditional method of manually interacting to recognize equipment list text, this solution uses multiple detection models to detect different types of information in the power distribution network engineering drawing and obtains the equipment list text from the drawing, thus improving the accuracy of equipment list text recognition.

[0082] In one embodiment, inputting the power distribution network engineering drawing to be identified into a trained table detection and reconstruction model includes: inputting the power distribution network engineering drawing to be identified into the trained table detection and reconstruction model, extracting equipment list features from the power distribution network engineering drawing to be identified by the table detection and reconstruction model, performing convolution operations on the equipment list features to obtain two-dimensional convolutional data corresponding to the equipment list features, normalizing the two-dimensional convolutional data, and smoothing the normalized two-dimensional convolutional data to output the table area image in the power distribution network engineering drawing to be identified.

[0083] In this embodiment, the terminal can identify table regions in a power distribution network engineering drawing using a table detection and reconstruction model. This model comprises multiple layers, such as an input layer, convolutional layers, activation functions, pooling layers, and fully connected layers. Within the convolutional layers of this model, the terminal can set various functions to identify table regions in the power distribution network engineering drawing. For example, after inputting the power distribution network engineering drawing into the trained table detection and reconstruction model, the model extracts equipment list features from the drawing and performs convolution operations on these features in the convolutional layers to obtain two-dimensional convolutional data corresponding to the equipment list features.

[0084] The table detection and reconstruction model can also normalize the two-dimensional convolutional data in the convolutional layer, and smooth the normalized two-dimensional convolutional data. The smoothed result is then input into the activation function, and the table area image in the power distribution network engineering drawing to be identified is obtained based on the activation function, pooling layer and fully connected layer.

[0085] Specifically, the terminal can pre-train a table detection and reconstruction model, where the loss function used in the table detection and reconstruction model can be the sigmoid loss function. This table detection and reconstruction model can be an improved HRNet model, and the power distribution network engineering drawing to be identified can be a CAD drawing of equipment list for 20KV and below power distribution networks. This drawing has a complex and diverse table structure layout, exhibiting complex heterogeneous forms such as uneven rows and columns, cell merging, splitting, or nesting. Therefore, the terminal can replace the convolutional layers in the original HRNet model with a CBS structure. CBS mainly consists of Conv+BN+SiLU, where Conv is the convolution operation, BN is the data normalization method (i.e., the normalization process mentioned above), and the SiLU function has a smoother curve when close to zero (i.e., the smoothing process mentioned above). Furthermore, because it uses the sigmoid loss function, the network output range can be between 0 and 1.

[0086] Specifically, the Conv function can be defined as follows: Where f and g(n) are two-dimensional convolutional data, τ is the integration variable and n is a parameter variable, such as the device list feature identified above; the result after integration is a function of n. The BN function can be shown below:

[0087] Input: B={x1...m}; γ, β (parameters to be learned)

[0088] Output: {y i =BN γ,β (x i )}

[0089]

[0090]

[0091]

[0092]

[0093] Where B is a set of values, such as the values ​​output by Conv after recognizing the device list features, γ and β are trainable parameters, m is the mini-batch size, and μ is the set of values. β It is the mean. It is the variance. The function of SiLU can be expressed as follows: sliu(x)=x / (1+e -x ); where x is the feature input value, such as the output value of the BN function mentioned above. The terminal can obtain the above table region image based on the output value of the SiLU function.

[0094] Through this embodiment, the terminal can identify the table area image in the power distribution network engineering drawing based on the improved HRNet model, and then identify the equipment list text based on the table area image, thereby improving the accuracy of equipment list text recognition.

[0095] In one embodiment, inputting a table region image into a trained text direction detection model includes: inputting the table region image into the trained text direction detection model, whereby the text direction detection model extracts a global feature map, multiple height channel feature maps, and multiple width channel feature maps corresponding to the table region image; merging multiple height channel feature maps and multiple width channel feature maps according to a channel attention mechanism to obtain a height channel feature map carrying spatial information and a width channel feature map carrying spatial information; modeling the height channel feature map carrying spatial information and the width channel feature map carrying spatial information according to a spatial attention mechanism to obtain a modeled height feature map and a modeled width feature map; merging the modeled height feature map, the modeled width feature map, and the global feature map to obtain a merged feature map; and recognizing and outputting text region boundary information based on the merged feature map.

[0096] In this embodiment, the aforementioned text direction detection model can identify text region boundary information in a table region image based on multiple dimensions. The terminal can first train the text direction detection model based on samples. For example, in one embodiment, the terminal can obtain power distribution network engineering drawing samples. These samples include table region image samples and corresponding text region boundary information samples. The terminal can input the table region image samples into the text direction detection model to be trained and obtain the predicted information of the text region boundary information output by the model. The terminal can input the predicted information and the text region boundary information samples into a first loss function. The first loss function obtains the intersection and union of the predicted information and the text region boundary information samples. Based on the ratios of these intersections and unions, the terminal adjusts the model parameters of the text direction detection model until a first preset training termination condition is met. At this point, the terminal obtains the trained text direction detection model, meaning it can determine whether the model training is complete based on the overlap between the text region boundary information and the text region boundary information samples.

[0097] The terminal can input the aforementioned table region image into a trained text direction detection model. The model extracts the global feature map, multiple height channel feature maps, and multiple width channel feature maps corresponding to the table region image. The height and width channel feature maps can be obtained by copying. The terminal can then merge the multiple height and width channel feature maps using a channel attention mechanism to obtain height and width channel feature maps carrying spatial information. Furthermore, the terminal can model the height and width channel feature maps carrying spatial information using a spatial attention mechanism to obtain modeled height and width feature maps. Finally, based on hybrid attention, the terminal can merge the modeled height, width, and global feature maps to obtain a merged feature map. After recognizing the text region boundary information based on this merged feature map, the terminal outputs the text region boundary information.

[0098] Specifically, the text direction detection model described above can be an improved YOLOv5m model. The terminal uses the Wise-IoU Loss loss function to replace the IoU Loss loss function; that is, the first loss function can be the Wise-IoU Loss loss function. This reduces the bias in the loss function evaluation results and improves the accuracy of text direction prediction. To better capture global contextual information, the terminal can introduce a newly designed FSA module into the text direction detection model. The terminal can then train the aforementioned text direction detection model.

[0099] The Wise-IoU Loss function mentioned above can be expressed as: Where WIOU is the output value of the loss function, and IOU is the intersection-union ratio, which can be expressed as: IOU = TP / (TP + FN + FP). IoU is the ratio of the overlapping area between the ground truth bounding boxes and the algorithm's detection boxes to their merged area; that is, the ratio of the intersection and union that the terminal can obtain. Specifically, as follows... Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the steps of training a text orientation detection model in one embodiment. n represents the number of bounding boxes, b i G represents the coordinates of the i-th object bounding box. i Represents the coordinates of the true bounding box of the i-th object, IOU(b i g i ) represents the IoU value between the i-th object bounding box and the ground truth bounding box, where b above i It can be represented as Figure 3 In (x, y), the above g i It can be represented as Figure 3 (x) gt ygt ), ω i H represents the weight value. g W g The height and width of the union of the predicted information and the text region boundary information samples, respectively, represent the H values ​​of the predicted information and the H values ​​of the predicted information and the text region boundary information samples. i W i These represent the height and width of the intersection of the predicted information of the text region boundary information and the text region boundary information sample, respectively.

[0100] After the terminal trains a text orientation detection model based on the aforementioned loss function, it can use this model to identify text region boundary information. Specifically, as follows... Figure 4 As shown, Figure 4 This is a flowchart illustrating the text region boundary information recognition step in one embodiment. The terminal can obtain contextual information based on the spatial and channel dimensions of the feature map. The input table region image can be divided into three branches, corresponding to the height H, width W, and number of channels C of the table region image, respectively. For each branch, the terminal can globally merge the height, width, and channel dimensions in the text orientation detection model to generate three feature maps, for example, dividing the table region image into a global feature map, a height channel feature map, and a width channel feature map. The global feature map is shown below. Figure 4 As shown in (H,W), the height channel feature map is as follows: Figure 4 As shown in (H,C), the width channel feature map is as follows. Figure 4 As shown in (W,C). The text orientation detection model can repeat the merged height and width branch feature maps multiple times to obtain a feature map of the same size as the input. The feature map with merged height and width, such as the global feature map mentioned above, is copied multiple times to match the size of the input feature map.

[0101] The text orientation detection model can apply channel attention to each copied feature map to obtain channel information, i.e., the aforementioned spatial information. To supplement the spatial information lost in the first two branches, the terminal can use spatial attention to model the relative positional relationships of the merged channel features and merge these feature maps to form the output of the hybrid attention module. This hybrid attention module is set within the text orientation detection model. This module uses a hybrid attention mechanism to calculate the importance of each pixel in the image and adjusts the feature maps to better capture global contextual information. Thus, the terminal can obtain the merged feature map, for example... Figure 4 The (H,W,C) in the merged feature map allows the terminal to identify and output text region boundary information.

[0102] Through the above embodiments, the terminal can use the Wise-IoU Loss function to train a text direction detection model, and use the trained text direction detection model to identify text region boundary information based on multiple dimensions, thereby improving the accuracy of device list text recognition.

[0103] In one embodiment, inputting a table region image carrying text region boundary information into a trained text detection model includes: inputting the table region image carrying text region boundary information into the trained text detection model, whereby the text detection model extracts text region boundary features corresponding to the table region image based on the text region boundary information in the network layer; inputting the text region boundary features into the convolutional layer of the text detection model, whereby the first branch of the convolutional layer identifies character positions based on the text region boundary features, and the second branch of the convolutional layer identifies character connection information based on the text region boundary features; and merging the character positions and character connection information to obtain and output a character region image.

[0104] In this embodiment, the aforementioned text detection model can identify character regions within the boundaries of text regions based on a multi-layered structure. The terminal can first train the text detection model based on samples. For example, in one embodiment, the terminal can acquire power distribution network engineering drawing samples. These samples include text region boundary information samples and corresponding character region image samples. The terminal can input the text region boundary information samples into the text detection model to be trained and obtain the character region image prediction information output by the model. The terminal can then acquire the Gaussian heatmap feature map corresponding to the character region image prediction information and adjust the model parameters of the text detection model to be trained based on the similarity between the Gaussian heatmap feature map and the character region image samples, until a second preset training termination condition is met, thus obtaining the trained text detection model.

[0105] The terminal can input the table region image carrying text region boundary information into a trained text detection model. The text detection model extracts the text region boundary features corresponding to the table region image based on the text region boundary information in the network layer. The text detection model also includes convolutional layers with multiple branches, each used to identify different features. The terminal can input the text region boundary features into the convolutional layers of the text detection model. The first branch of the convolutional layer identifies character positions based on the text region boundary features, and the second branch identifies character connection information based on the text region boundary features. The character position can be determined based on the pixel at the character center, and the character connection information can be determined based on the gap between adjacent characters. The terminal can merge the character positions and character connection information to obtain a character region image, and then output the character region image.

[0106] Specifically, the text detection model described above can be an improved CRAFT model with an enhanced backbone network. For example... Figure 5 As shown, Figure 5 This is a flowchart illustrating the character region image recognition steps in one embodiment. The terminal can train the text detection model to be trained by generating two feature labels: Region ScoreGround (character Gaussian heatmap feature map) and Affinity Score Ground (inter-character connection Gaussian heatmap feature map). Based on the trained text detection model, the terminal can generate character region image prediction information, which includes character position prediction information such as... Figure 5 The character box in the text also includes character connection information and prediction information, such as... Figure 5 The terminal can generate neighborhood boxes using character boxes and generate two-dimensional Gaussian mapping values, namely, the Gaussian heatmap feature map corresponding to the character position and the Gaussian heatmap feature map corresponding to the character connection information. The terminal can calculate the perspective transformation between the Gaussian feature map and each character box, and also calculate the perspective transformation between the Gaussian feature map and each neighborhood box. Thus, the terminal can map the Gaussian feature map to the character box or neighborhood box to obtain the Region Score GT and the Affinity Score GT. Based on the Region Score and Affinity Score, the terminal can adjust the model parameters of the text detection model to be trained, and obtain the trained text detection model when the second preset training termination condition is met. The second preset training termination condition can be that within a preset number of training iterations, both the Region Score and Affinity Score reach preset values, or the number of training iterations reaches the preset number of training iterations.

[0107] like Figure 6 As shown, Figure 6 This is a schematic diagram of the text detection model in one embodiment. The terminal can use VGG16 as the backbone network of the above text detection model and use a feature pyramid fusion structure to fuse the feature maps of deep and shallow layers for output. This effectively preserves the shallow feature structure and the deep semantic feature structure. The terminal can add a convolutional layer after the network layer that performs feature extraction. The final 1x1 convolutional layer uses two convolutional kernels to output two branches, namely the results of the first branch and the second branch mentioned above. The first branch is the probability that each pixel is located at the center of a character, which is the position score of the text, such as the region score mentioned above; the second branch is the probability that each pixel is located in the gap between characters, which is the gap score of the characters, such as the association score mentioned above. Through the output of these two layers, the terminal obtains the character position and the connection between characters, and then integrates the results into a text box, such as recognizing coherent sentences and words, as well as the regions of each character in each sentence or word, thereby obtaining the character region image mentioned above.

[0108] Through the above embodiments, the terminal can train a text detection model based on Gaussian heatmap feature maps and recognize character region images based on the CRAFT text detection model with an improved backbone network, thereby improving the accuracy of text recognition in character region images.

[0109] In one embodiment, inputting a character region image into a trained character recognition model includes: inputting the character region image into the trained character recognition model, whereby the character recognition model extracts character region features from the character region image in a convolutional layer; inputting the character region features into a recurrent layer of the character recognition model, whereby the character sequence features are identified based on an attention mechanism in the recurrent layer; inputting the character sequence features into a transcriptional layer of the character recognition model, whereby the character sequence features are identified based on a normalized exponential function in the transcriptional layer, and outputting the corresponding text information based on the character sequence.

[0110] In this embodiment, the aforementioned character recognition model can recognize characters in character region images based on a multi-layer structure. The terminal can first train the character recognition model based on samples. For example, in one embodiment, the terminal can acquire power distribution network engineering drawing samples. These samples include character region image samples and corresponding text information samples. The terminal can input the text information samples into the character recognition model to be trained and obtain the predicted information of the text information output by the model. The aforementioned character recognition model includes a second preset loss function. The terminal can input the predicted information of multiple text information and multiple text information samples into the second preset loss function. Based on the recognition probability of the predicted information of the target text information, the terminal adjusts the model parameters of the character recognition model to be trained until a third preset training termination condition is met, thus obtaining the trained character recognition model. The predicted information of the target text information represents the predicted information of the multiple text information samples whose similarity to the multiple text information samples is greater than a preset similarity threshold. That is, the terminal compares the similarity of the predicted information of multiple text information with the multiple text information samples and uses the predicted information of the text information with a similarity greater than the preset similarity threshold as the predicted information of the target text information. The third preset training termination condition mentioned above may be that, within a preset number of training iterations, the recognition probability of the predicted information of the target text information is greater than a preset probability threshold, or the number of training iterations reaches the preset number of training iterations mentioned above.

[0111] The aforementioned character recognition model also includes convolutional layers, recurrent layers, and transcription layers. The terminal can input the character region image into the trained character recognition model. The model extracts character region features from the image in the convolutional layers and inputs these features into the recurrent layers. In the recurrent layers, an attention mechanism is used to identify the character sequence features corresponding to the character region features. Alternatively, the terminal can input the character sequence features into the transcription layers. In the transcription layers, a normalized exponential function is used to identify the character sequence features, allowing the character recognition model to output corresponding text information based on the character sequence. For example, the equipment list text in the aforementioned power distribution network engineering drawing.

[0112] Specifically, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the text recognition model in one embodiment. The text recognition model described above can be an improved CRNN (Convolutional Recurrent Neural Network) text recognition model. The CRNN text recognition model adopts a structure of CNN (Convolutional Neural Networks) + RNN (Recurrent Neural Network) + CTC (Connectionist Temporal Classification), i.e., the CRNN structure. The CRNN mainly includes three layers, specifically a convolutional layer, a recurrent layer, and a transcription layer. The improvement to the CNN involves replacing the CNN backbone network; the terminal can use a RepVGG network to replace the VGG16 network, reducing the number of convolutional layers to improve speed and reduce space. The RNN uses a BiLSTM (Bi-directional Long Short-Term Memory) network structure, and attention is added to the BiLSTM, i.e., an attention mechanism structure.

[0113] In this context, the terminal can use the CTC loss function in the character recognition model. Traditionally, when using BiLSTM+softmax for character output, each column of output needs to correspond to a single character element. In practice, it's difficult for the terminal to align samples, such as marking characters and their positions. Therefore, the terminal can use a CTC loss function that doesn't require alignment, replacing the original softmax loss function. During the training of the character recognition model, the terminal can use the aforementioned CTC loss function to determine the accuracy of the recognition results. Specifically, the CTC loss function can be expressed as: L(S)=-In∏ (x,z)∈S p(z|x)=-∑ (x,z)∈S Inp(z|x). Here, p(z|x) represents the probability of the input text x and the output sequence z, that is, the probability that the output sequence is z given the input text x. Then z can be represented as the target text information mentioned above. S is the dataset, such as the prediction information of the input text information mentioned above. lnp(z|x) is the logarithm of the probability.

[0114] The aforementioned character region image can include text boxes containing characters. After the terminal trains a text recognition model, it can extract text box image features in the convolutional layer. Given a fixed image length, the terminal can initialize the image to a size of 64×W×3, where W is any image width, and convert it into a 1×32×512 feature matrix. The terminal can also use a BiLSTM network structure with an attention mechanism in the recurrent layer to extract text sequence features from the 1×32×512 feature matrix extracted by the convolutional layer. Furthermore, in the transcription layer, the terminal can perform softmax on the output features of the BiLSTM with the attention mechanism to output the characters, thus obtaining the aforementioned text information.

[0115] Through the above embodiments, the terminal can perform text recognition in the equipment list based on the improved CRNN network, thereby improving the accuracy of text recognition in the equipment list of CAD drawings.

[0116] In one embodiment, such as Figure 8 As shown, Figure 8 This is a flowchart illustrating the equipment list text recognition method in another embodiment. In this embodiment, the terminal can pre-build a dataset of CAD drawings for equipment lists of 20KV and below power distribution network projects. This dataset can be divided into training sets, validation sets, and test sets. The terminal can train the respective models based on the datasets described above.

[0117] For distribution network engineering drawings to be identified, such as CAD drawings of equipment lists for 20kV and below distribution network projects, the terminal can obtain the position of the table and reconstruct the table based on an improved HRNet table detection and reconstruction model. After detecting the table position, a text direction detection model based on an improved YOLOv5m is constructed to detect text borders. Furthermore, the terminal uses an improved backbone network CRAFT text detection model to perform text detection on the equipment list in the distribution network engineering drawings. In addition, the terminal can also construct an improved CRNN text recognition model to recognize the detected text boxes. This enables the recognition of equipment list text in CAD drawings of equipment lists for 20kV and below distribution network projects.

[0118] Through the above embodiments, the terminal detects different types of information in the distribution network engineering drawings using multiple detection models and obtains the equipment list text in the drawings, improving the accuracy of equipment list text recognition. This enables more precise, faster, and higher-speed recognition and extraction of distribution network engineering drawings. Step A includes:

[0119] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0120] Based on the same inventive concept, this application also provides an apparatus for implementing the above-described apparatus for recognizing text in an equipment list. The solution provided by this apparatus is similar to the solution described in the above-described method; therefore, the specific limitations in one or more apparatus embodiments provided below can be found in the limitations of the equipment list text recognition method described above, and will not be repeated here.

[0121] In one embodiment, such as Figure 9 As shown, a device for recognizing text in an equipment list is provided, comprising: an acquisition module 500, a first recognition module 502, a second recognition module 504, a third recognition module 506, and a fourth recognition module 508, wherein:

[0122] The acquisition module 500 is used to acquire the power distribution network engineering drawings to be identified; the power distribution network engineering drawings to be identified include an equipment list.

[0123] The first recognition module 502 is used to input the power distribution network engineering drawing to be recognized into the trained table detection and table reconstruction model, and obtain the table area image in the power distribution network engineering drawing to be recognized output by the table detection and table reconstruction model based on a multi-layer network.

[0124] The second recognition module 504 is used to input the table region image into the trained text direction detection model, obtain the text direction detection model, and obtain the text region boundary information in the table region image output by the text direction detection model based on the spatial dimension and the channel dimension; the text region boundary information represents the boundary information of the region where text exists in the table region image.

[0125] The third recognition module 506 is used to input a table region image carrying text region boundary information into a trained text detection model to obtain a character region image output by the text detection model after recognizing character positions and character connection information based on the text region boundary information; the character region image represents the image of the region where each character is located in the table region image.

[0126] The fourth recognition module 508 is used to input the character region image into the trained text recognition model, obtain the text information output by the text recognition model based on the character region image, and determine the equipment list text corresponding to the equipment list in the power distribution engineering drawing to be recognized based on the text information.

[0127] In one embodiment, the first identification module 502 is specifically used to input the power distribution network engineering drawing to be identified into a trained table detection and table reconstruction model, extract the equipment list features in the power distribution network engineering drawing to be identified by the table detection and table reconstruction model, perform convolution operation on the equipment list features to obtain two-dimensional convolution data corresponding to the equipment list features, normalize the two-dimensional convolution data, and smooth the normalized two-dimensional convolution data before outputting the table area image in the power distribution network engineering drawing to be identified.

[0128] In one embodiment, the second recognition module 504 is specifically used to input the table region image into a trained text direction detection model, which extracts the global feature map, multiple height channel feature maps, and multiple width channel feature maps corresponding to the table region image. Based on a channel attention mechanism, the model merges the multiple height channel feature maps and the multiple width channel feature maps to obtain a height channel feature map carrying spatial information and a width channel feature map carrying spatial information. Based on a spatial attention mechanism, the modeling of the height channel feature map carrying spatial information and the width channel feature map carrying spatial information is performed to obtain a modeled height feature map and a modeled width feature map. The modeled height feature map, the modeled width feature map, and the global feature map are merged to obtain a merged feature map. The modeled feature map is then used to identify and output the text region boundary information.

[0129] In one embodiment, the third recognition module 506 is specifically used to input a table region image carrying text region boundary information into a trained text detection model, whereby the text detection model extracts text region boundary features corresponding to the table region image based on the text region boundary information in the network layer; inputs the text region boundary features into the convolutional layer of the text detection model, whereby the first branch of the convolutional layer identifies character positions based on the text region boundary features, and the second branch of the convolutional layer identifies character connection information based on the text region boundary features; and merges the character positions and character connection information to obtain and output a character region image.

[0130] In one embodiment, the fourth recognition module 508 is specifically used to input a character region image into a trained character recognition model, whereby the character recognition model extracts character region features from the character region image in a convolutional layer; inputs the character region features into a recurrent layer of the character recognition model, whereby the character sequence features corresponding to the character region features are recognized based on an attention mechanism; inputs the character sequence features into a transcriptional layer of the character recognition model, whereby the character sequence features are recognized based on a normalized exponential function, and outputs the corresponding text information based on the character sequence.

[0131] In one embodiment, the above-mentioned apparatus further includes: a first training module, configured to acquire power distribution network engineering drawing samples; the power distribution network engineering drawing samples include table area image samples and text area boundary information samples corresponding to the table area image samples; input the table area image samples into a text direction detection model to be trained, and acquire the predicted information of the text area boundary information output by the text direction detection model to be trained; input the predicted information of the text area boundary information and the text area boundary information samples into a first loss function, and adjust the model parameters of the text direction detection model to be trained based on the ratio of the intersection and union of the predicted information of the text area boundary information and the text area boundary information samples through the first loss function, until the first preset training termination condition is met, and the trained text direction detection model is obtained.

[0132] In one embodiment, the above apparatus further includes: a second training module, configured to acquire power distribution network engineering drawing samples; the power distribution network engineering drawing samples include text region boundary information samples and character region image samples corresponding to the text region boundary information samples; input the text region boundary information samples into the text detection model to be trained, acquire the character region image prediction information output by the text detection model to be trained; acquire the Gaussian heatmap feature map corresponding to the character region image prediction information, and adjust the model parameters of the text detection model to be trained according to the similarity between the Gaussian heatmap feature map and the character region image samples, until the second preset training termination condition is met, thereby obtaining the trained text detection model.

[0133] In one embodiment, the above-mentioned apparatus further includes: a third training module, used to acquire power distribution network engineering drawing samples; the power distribution network engineering drawing samples include character region image samples and text information samples corresponding to the character region image samples; inputting the text information samples into a text recognition model to be trained, and acquiring the predicted information of the text information output by the text recognition model to be trained; inputting the predicted information of multiple text information and multiple text information samples into a second preset loss function, and adjusting the model parameters of the text recognition model to be trained based on the recognition probability of the predicted information of the target text information through the second preset loss function, until the third preset training termination condition is met, and obtaining the trained text recognition model; the predicted information of the target text information represents the predicted information of the text information whose similarity to the multiple text information samples is greater than a preset similarity threshold among the predicted information of multiple text information.

[0134] In one embodiment, the above-mentioned apparatus further includes: a sample acquisition module, used to acquire an original power distribution network engineering drawing sample; and to adjust the brightness and / or text direction of the power distribution network engineering drawing sample to obtain a data-enlarged power distribution network engineering drawing sample.

[0135] Each module in the aforementioned device list text recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0136] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a device list text recognition method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device casing, or an external keyboard, touchpad, or mouse.

[0137] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0138] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the device list text recognition method described above.

[0139] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the device list text recognition method described above.

[0140] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the device list text recognition method described above.

[0141] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0142] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0143] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0144] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for recognizing text in an equipment list, characterized in that, The method includes: Obtain the drawings of the distribution network project to be identified; the drawings of the distribution network project to be identified include an equipment list; The power distribution network engineering drawing to be identified is input into the trained table detection and table reconstruction model to obtain the table area image in the power distribution network engineering drawing to be identified, which is output by the table detection and table reconstruction model based on a multi-layer network. The process involves inputting the table region image into a trained text direction detection model to obtain text region boundary information in the table region image based on spatial and channel dimensions. This includes: inputting the table region image into the trained text direction detection model, which extracts a global feature map, multiple height channel feature maps, and multiple width channel feature maps corresponding to the table region image; obtaining the multiple height channel feature maps and multiple width channel feature maps by repeatedly processing the height and width branch feature maps to obtain feature maps of the same size as the input; and obtaining the global feature map by multiple copies to match the size of the input feature map; and merging the multiple height channel feature maps and the multiple width channel feature maps according to a channel attention mechanism. A height channel feature map carrying spatial information and a width channel feature map carrying spatial information are obtained. Based on a spatial attention mechanism, the height channel feature map and the width channel feature map carrying spatial information are modeled respectively to obtain modeled height feature maps and modeled width feature maps. The modeled height feature map, the modeled width feature map, and the global feature map are merged to obtain a merged feature map, which forms the output of the hybrid attention module in the text direction detection model. The text region boundary information is identified and output based on the merged feature map. The hybrid attention module uses a hybrid attention mechanism to calculate the importance of each pixel in the image and adjusts the feature map to capture global contextual information. The text region boundary information represents the boundary information of the regions containing text in the table region image. A table region image carrying text region boundary information is input into a trained text detection model to obtain a character region image output by the text detection model after recognizing character positions and character connection information based on the text region boundary information; the character region image represents the image of the region where each character is located in the table region image; The character region image is input into a trained text recognition model to obtain the text information output by the text recognition model based on the character region image, and the equipment list text corresponding to the equipment list in the power distribution network engineering drawing to be recognized is determined according to the text information.

2. The method according to claim 1, characterized in that, The step of inputting the power distribution network engineering drawings to be identified into the trained table detection and table reconstruction model includes: The power distribution network engineering drawing to be identified is input into the trained table detection and table reconstruction model. The table detection and table reconstruction model extracts the equipment list features in the power distribution network engineering drawing to be identified. The equipment list features are then subjected to convolution operation to obtain the two-dimensional convolution data corresponding to the equipment list features. The two-dimensional convolutional data is normalized, and then smoothed before the table area image in the power distribution network engineering drawing to be identified is output.

3. The method according to claim 1, characterized in that, The step of inputting the table region image carrying text region boundary information into the trained text detection model includes: A table region image carrying text region boundary information is input into a trained text detection model, which then extracts the text region boundary features corresponding to the table region image based on the text region boundary information in the network layer. The text region boundary features are input into the convolutional layer of the text detection model. The first branch of the convolutional layer identifies the character position based on the text region boundary features, and the second branch of the convolutional layer identifies the character connection information based on the text region boundary features. The character position and character connection information are combined to obtain and output a character region image.

4. The method according to claim 1, characterized in that, The step of inputting the character region image into the trained character recognition model includes: The character region image is input into a trained character recognition model, which extracts the character region features of the character region image in a convolutional layer. The character region features are input into the recurrent layer of the character recognition model, and the character sequence features corresponding to the character region features are identified in the recurrent layer based on the attention mechanism. The character sequence features are input into the transcription layer of the character recognition model. In the transcription layer, the character sequence corresponding to the character sequence features is identified based on the normalized exponential function, and the corresponding text information is output according to the character sequence.

5. The method according to claim 1, characterized in that, The method further includes: Obtain a power distribution network engineering drawing sample; the power distribution network engineering drawing sample includes a table area image sample and a text area boundary information sample corresponding to the table area image sample; The image sample of the table region is input into the text direction detection model to be trained, and the predicted information of the text region boundary information output by the text direction detection model to be trained is obtained. The predicted information of the text region boundary information and the text region boundary information samples are input into a first loss function. The first loss function adjusts the model parameters of the text direction detection model to be trained based on the ratio of the intersection and union of the predicted information of the text region boundary information and the text region boundary information samples, until the first preset training termination condition is met, and the trained text direction detection model is obtained.

6. The method according to claim 1, characterized in that, The method further includes: Obtain a power distribution network engineering drawing sample; the power distribution network engineering drawing sample includes a text area boundary information sample and a character area image sample corresponding to the text area boundary information sample. Input the text region boundary information sample into the text detection model to be trained, and obtain the character region image prediction information output by the text detection model to be trained; Obtain the Gaussian heatmap feature map corresponding to the character region image prediction information. Adjust the model parameters of the text detection model to be trained based on the similarity between the Gaussian heatmap feature map and the character region image sample until the second preset training termination condition is met, and obtain the trained text detection model.

7. The method according to claim 1, characterized in that, The method further includes: Obtain a power distribution network engineering drawing sample; the power distribution network engineering drawing sample includes a character area image sample and a text information sample corresponding to the character area image sample; The text information sample is input into the text recognition model to be trained, and the predicted information of the text information output by the text recognition model to be trained is obtained. The predicted information of multiple text information and multiple text information samples are input into a second preset loss function. Based on the recognition probability of the predicted information of the target text information, the model parameters of the text recognition model to be trained are adjusted by the second preset loss function until a third preset training termination condition is met, and a trained text recognition model is obtained. The predicted information of the target text information represents the predicted information of the text information whose similarity with the multiple text information samples is greater than a preset similarity threshold among the predicted information of the multiple text information.

8. The method according to any one of claims 5 to 7, characterized in that, The process of obtaining power distribution network engineering drawing samples includes: Obtain original power distribution network engineering drawings samples; The brightness and / or text direction of the power distribution network engineering drawing sample are adjusted respectively to obtain the data-expanded power distribution network engineering drawing sample.

9. A device for recognizing text in an equipment list, characterized in that, The device includes: The acquisition module is used to acquire the power distribution network engineering drawings to be identified; the power distribution network engineering drawings to be identified include an equipment list. The first identification module is used to input the power distribution network engineering drawing to be identified into a trained table detection and table reconstruction model, and obtain the table area image in the power distribution network engineering drawing to be identified by the table detection and table reconstruction model based on a multi-layer network. The second recognition module is used to input the table region image into a trained text direction detection model to obtain the text region boundary information in the table region image output by the text direction detection model based on spatial and channel dimensions. Specifically, it is used to: input the table region image into the trained text direction detection model, and have the text direction detection model extract the global feature map, multiple height channel feature maps, and multiple width channel feature maps corresponding to the table region image; the multiple height channel feature maps and multiple width channel feature maps are obtained by repeatedly processing the branch feature maps of height and width multiple times to obtain feature maps of the same size as the input; the global feature map is obtained by copying multiple times to match the size of the input feature map; and according to the channel attention mechanism, merge the multiple height channel feature maps and merge the multiple width channel feature maps. The text direction detection model generates a height channel feature map and a width channel feature map carrying spatial information. Based on the spatial attention mechanism, the height channel feature map and the width channel feature map carrying spatial information are modeled to obtain modeled height and width feature maps. The modeled height and width feature maps are then merged with the global feature map to obtain a merged feature map, which forms the output of the hybrid attention module in the text direction detection model. The merged feature map is used to identify and output the text region boundary information. The hybrid attention module uses a hybrid attention mechanism to calculate the importance of each pixel in the image and adjusts the feature map to capture global contextual information. The text region boundary information represents the boundary information of the regions containing text in the table region image. The third recognition module is used to input a table region image carrying text region boundary information into a trained text detection model, and obtain a character region image output by the text detection model after recognizing character positions and character connection information based on the text region boundary information; the character region image represents the image of the region where each character is located in the table region image; The fourth recognition module is used to input the character region image into a trained text recognition model, obtain the text information output by the text recognition model based on the character region image, and determine the equipment list text corresponding to the equipment list in the power distribution network engineering drawing to be recognized based on the text information.

10. The apparatus according to claim 9, characterized in that, The first identification module is used for: The power distribution network engineering drawing to be identified is input into the trained table detection and table reconstruction model. The table detection and table reconstruction model extracts the equipment list features in the power distribution network engineering drawing to be identified. The equipment list features are then subjected to convolution operation to obtain the two-dimensional convolution data corresponding to the equipment list features. The two-dimensional convolutional data is normalized, and then smoothed before the table area image in the power distribution network engineering drawing to be identified is output.