Transmission tower engineering drawing size text recognition method and device, terminal equipment and computer readable storage medium
Through the training of the dimension text position recognition model and the dimension text information recognition model, combined with the Clip model, the dimension text information in the transmission pole tower engineering drawings is automatically identified, which solves the problems of low efficiency and low accuracy of manual reading drawings, and realizes efficient and accurate engineering drawing processing.
Patent Information
- Application Number
- CN202411646159.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-07
AI Technical Summary
When processing a large number of transmission pole tower engineering drawings, manual drawing reading is inefficient and accurate, and the splicing operation of a single geometry is very time-consuming, making it difficult to achieve the automatic extraction of data parameters of the engineering drawings.
By obtaining the tower engineering drawings to be identified, input them into the training-completed dimension text position recognition model, automatically identify the dimension text position in the engineering drawing, and input the target detection image into the training-completed dimension text information recognition model, identify the dimension text information, and finally combine the Clip model to determine the final dimension text information.
It realizes the automatic completion of the dimension text position recognition and the dimension text information recognition of the tower engineering drawings, avoiding the inefficiency and inaccuracy of manual operations, and improving the efficiency and accuracy of engineering drawing processing.
Smart Images

Figure CN119580295A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of engineering drawing text recognition, and in particular to a method, device, terminal equipment and computer-readable storage medium for recognizing dimension text of transmission tower engineering drawings. Background Art
[0002] As the main power transmission facilities in my country, transmission towers may cause huge losses to people's property and life and health without early warning and timely troubleshooting. Past accident data show that under severe weather conditions such as strong winds, the collapse and damage of transmission towers occur from time to time. These accidents not only cause economic losses, but may also cause casualties. In order to solve this problem, China Southern Power Grid mentioned that power grid digitalization is the best solution to support intelligent production and has become the digital infrastructure of the power grid.
[0003] Common digital modeling methods include those based on engineering drawings and those based on laser scanning. In the case of digital modeling based on engineering drawings, engineers read the data in the engineering drawings, draw sketches in 3D software, and then perform a series of operations such as stretching, rotating, and combining to finally form a 3D model. However, when faced with a large number of engineering drawings, manual reading is inefficient and inaccurate, and the splicing of a single geometric body is very time-consuming. Therefore, how to automatically extract the parameters of 2D engineering drawing data through a computer is an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, terminal equipment and computer-readable storage medium for recognizing dimension text of transmission tower engineering drawings, which avoid the inefficiency and inaccuracy of manual operation and improve the efficiency and accuracy of tower engineering drawing processing.
[0005] An embodiment of the present invention provides a method for recognizing dimension text of a transmission tower engineering drawing, comprising:
[0006] Obtain engineering drawings of the tower to be identified;
[0007] Inputting the pole tower engineering drawing to be identified into the trained dimension text position recognition model, so that the dimension text position recognition model recognizes the dimension text position of the pole tower engineering drawing to be identified, and obtains the position of each dimension text box in the pole tower engineering drawing to be identified;
[0008] Extract the image corresponding to the position of each dimension text box in the engineering drawing of the tower to be identified as the target detection image;
[0009] The target detection image is input into the trained dimension text information recognition model, so that the dimension text information recognition model recognizes the dimension text information of the target detection image to obtain the first dimension text information corresponding to the target detection image.
[0010] Furthermore, after obtaining the first size text information corresponding to the target detection image, the method further includes:
[0011] Input the target detection image into the preset Clip large model, so that the Clip large model recognizes the size text information of the target detection image, and obtains the second size text information corresponding to the target detection image;
[0012] The repeated dimension text in the first dimension text information and the second dimension text information is used as the final dimension text information.
[0013] Furthermore, the method for recognizing dimension text of transmission tower engineering drawings also includes:
[0014] Determine whether there is non-repeated size text in the first size text information and the second size text information. If so, send a check signal and output a corresponding target detection image. If not, do not perform any operation.
[0015] Furthermore, the dimension text location recognition model is trained in the following way:
[0016] Obtain an ImageNet dataset, and input the ImageNet dataset into the initialized size text position recognition model for iterative training until the first loss function converges, thereby obtaining a pre-trained size text position recognition model;
[0017] Acquire a plurality of training images; wherein each training image comprises a plurality of training bounding boxes and corresponding real tower texts;
[0018] Several training images are respectively input into the pre-trained dimension text position recognition model, so that the pre-trained dimension text position recognition model takes the training image as input and the various predicted bounding boxes in the training image as output for training, and during the training process, the network parameters of the dimension text position recognition model are adjusted according to the various predicted bounding boxes of each training image and the corresponding training bounding boxes until the second loss function converges to obtain the trained dimension text position recognition model.
[0019] Furthermore, the training images are obtained in the following way:
[0020] Obtain a blank image and a random number of real tower texts;
[0021] Input each real tower text into the trained diffusion model, so that the diffusion model generates a corresponding interference text image according to each real tower text;
[0022] According to the preset border range and the ratio of each interfering text image, a corresponding blank boundary box is randomly generated in the blank image;
[0023] Each interference text image is embedded in the corresponding blank bounding box to obtain a training image.
[0024] Furthermore, the diffusion model is trained in the following way:
[0025] Use the freetype tool to randomly combine numbers, letters, and decimal points of different font types to obtain a number of random numbers;
[0026] Convert each random number into a corresponding digital image through the PIL library;
[0027] Each digital image is blurred by using mean, median or Gaussian filtering, and Gaussian or salt and pepper noise is added to obtain the corresponding real interference digital image;
[0028] Each random number and the corresponding real interference digital image are input into the diffusion model to be trained, so that the diffusion model takes the random number as input and the predicted interference digital image as output, and during the training process, the network parameters of the diffusion model are adjusted according to each predicted interference digital image and the corresponding real interference digital image until the third loss function converges to obtain the trained diffusion model.
[0029] Furthermore, the dimension text information recognition model is trained in the following way:
[0030] Obtaining a SynthAdd data set, and inputting the SynthAdd data set into the initialized dimension text information recognition model for iterative training until the fourth loss function converges, thereby obtaining a pre-trained dimension text information recognition model;
[0031] For each training image, each interference text image in the training image and the corresponding real tower text are respectively input into the pre-trained dimension text information recognition model, so that the pre-trained dimension text information recognition model is trained with the interference text image as input and the predicted tower text as output, and during the training process, the network parameters of the dimension text information recognition model are adjusted according to the predicted tower text and the corresponding real tower text until the fifth loss function converges, thereby obtaining the trained dimension text information recognition model.
[0032] Based on the above method embodiment, the present invention provides a corresponding device embodiment, including: an engineering drawing acquisition module, a dimension text position recognition module, an image extraction module, and a dimension text information recognition module;
[0033] An engineering drawing acquisition module is used to acquire engineering drawings of the tower to be identified;
[0034] The dimension text position recognition module is used to input the pole tower engineering drawing to be recognized into the trained dimension text position recognition model, so that the dimension text position recognition model recognizes the dimension text position of the pole tower engineering drawing to be recognized, and obtains the position of each dimension text box in the pole tower engineering drawing to be recognized;
[0035] An image extraction module is used to extract images corresponding to the positions of the dimension text boxes in the engineering drawings of the tower to be identified as target detection images;
[0036] The dimension text information recognition module is used to input the target detection image into the trained dimension text information recognition model so that the dimension text information recognition model recognizes the dimension text information of the target detection image and obtains the first dimension text information corresponding to the target detection image.
[0037] Based on the above-mentioned method item embodiment, the present invention provides a corresponding terminal device item embodiment, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the steps of the method for identifying the dimension text of the transmission tower engineering drawing as described in the present invention are implemented.
[0038] Based on the above-mentioned method item embodiment, the present invention provides a corresponding computer-readable storage medium item embodiment, including: a stored computer program, when the computer program is running, controlling the device where the computer-readable storage medium is located to execute the steps of the method for identifying the dimension text of the transmission tower engineering drawing as described in the present invention.
[0039] Compared with the prior art, the beneficial effects of the embodiment of this solution are:
[0040] The present invention inputs the acquired pole tower engineering drawings to be identified into a trained dimension text position recognition model, automatically identifies the dimension text position in the engineering drawings, avoids the process of manually searching and marking the dimension text in the drawings, and improves the recognition efficiency; then automatically extracts the images corresponding to each dimension text box in the engineering drawings, avoids the time-consuming operation of manually cropping the image; inputs the images corresponding to each dimension text box into the trained dimension text information recognition model, and automatically identifies the dimension text information in the target detection image.
[0041] In summary, the present invention completes the dimension text position recognition and dimension text information recognition of the pole tower engineering drawing through model automation, avoids the inefficiency and inaccuracy of manual operation, and improves the efficiency and accuracy of pole tower engineering drawing processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flow chart of a method for recognizing dimension text of a transmission tower engineering drawing provided by an embodiment of the present invention;
[0043] Figure 2 It is a flowchart of a dimension text position recognition model training process provided by an embodiment of the present invention;
[0044] Figure 3 It is a partially interfering text image generated based on a trained diffusion model provided by an embodiment of the present invention;
[0045] Figure 4 It is a flowchart of a dimension text information recognition model training process provided by an embodiment of the present invention;
[0046] Figure 5 is a comparison diagram of dimension text recognition results provided by an embodiment of the present invention;
[0047] Figure 6 The present invention is a schematic diagram of the structure of a device for recognizing dimension text of a transmission tower engineering drawing provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0050] like Figure 1 As shown, an embodiment of the present invention provides a method for recognizing dimension text of a transmission tower engineering drawing, the method comprising at least the following steps:
[0051] Step S1: obtaining engineering drawings of the tower to be identified;
[0052] For step S1, first, obtain the electronic version of the pole tower engineering drawing to be identified, for example, the PDF format or image format (such as JPEG, PNG, etc.) of the pole tower engineering drawing. If the pole tower engineering drawing is a paper version, it needs to be digitized, which can be done by scanning the paper drawing or taking a photo of the drawing with a digital camera.
[0053] Step S2: inputting the pole tower engineering drawing to be identified into the trained dimension text position recognition model, so that the dimension text position recognition model recognizes the dimension text position of the pole tower engineering drawing to be identified, and obtains the position of each dimension text box in the pole tower engineering drawing to be identified;
[0054] For step S2, the pole tower engineering drawing to be identified is input into a pre-trained dimension text position recognition model. After learning a large amount of training data, the model has the ability to recognize the position of dimension text in the pole tower engineering drawing. Therefore, the dimension text position recognition model will process the drawing and output the position information of each dimension text box. This position information can be represented as a bounding box, usually represented by the coordinates of a rectangle, which can accurately identify the specific position of the dimension text in the drawing.
[0055] The following is a detailed description of the training process of the dimension text location recognition model:
[0056] like Figure 2 As shown in the figure, the training process of the dimension text position recognition model includes the following steps:
[0057] Step S201: Obtain an ImageNet dataset, and input the ImageNet dataset into an initialized size text position recognition model for iterative training until a first loss function converges, thereby obtaining a pre-trained size text position recognition model;
[0058] For step S201, in the training process of the dimension text position recognition model, the model needs to be pre-trained using the ImageNet dataset: first, a large amount of image data is obtained from the ImageNet dataset, and these images cover a variety of different categories and scenes. These images will be used as training samples for model pre-training; then, the preprocessed ImageNet dataset is input into the initialized dimension text position recognition model for iterative training, wherein, in each iterative training process, the first loss function between the model output and the actual label is calculated, and the back propagation algorithm is used to update the parameters of the model. By performing multiple iterative trainings, the model parameters are gradually optimized so that it can better recognize the location information of the dimension text. The model is iteratively trained until the first loss function converges, which means that the error between the model's prediction result and the actual label has reached a low level, and the model has a good dimension text position recognition capability, thereby obtaining a pre-trained dimension text position recognition model.
[0059] It should be noted that the ImageNet dataset is a widely used large-scale image dataset that contains millions of images and corresponding labels, covering thousands of categories, including animals, objects, scenes and other different image contents.
[0060] Through pre-training, we can use the rich image information of the ImageNet dataset to provide more training samples for the model, thereby improving the performance of the model in the dimension text location recognition task. At the same time, the pre-trained model can provide better initial parameters for subsequent training tasks and lay the foundation for accurate recognition of dimension text locations.
[0061] Step S202: obtaining a plurality of training images, wherein each training image comprises a plurality of training bounding boxes and corresponding real tower texts;
[0062] In a preferred embodiment, the training image is obtained by:
[0063] Obtain a blank image and a random number of real tower texts;
[0064] Input each real tower text into the trained diffusion model, so that the diffusion model generates a corresponding interference text image according to each real tower text;
[0065] According to the preset border range and the ratio of each interfering text image, a corresponding blank boundary box is randomly generated in the blank image;
[0066] Each interference text image is embedded in the corresponding blank bounding box to obtain a training image.
[0067] In a preferred embodiment, the diffusion model is trained in the following manner:
[0068] Use the freetype tool to randomly combine numbers, letters, and decimal points of different font types to obtain a number of random numbers;
[0069] Convert each random number into a corresponding digital image through the PIL library;
[0070] Each digital image is blurred by using mean, median or Gaussian filtering, and Gaussian or salt and pepper noise is added to obtain the corresponding real interference digital image;
[0071] Each random number and the corresponding real interference digital image are input into the diffusion model to be trained, so that the diffusion model takes the random number as input and the predicted interference digital image as output, and during the training process, the network parameters of the diffusion model are adjusted according to each predicted interference digital image and the corresponding real interference digital image until the third loss function converges to obtain the trained diffusion model.
[0072] In step S202, a number of training images are obtained as training samples of the dimension text position recognition model, wherein each training image includes one or more training bounding boxes, and each bounding box corresponds to a tower dimension text in the training image.
[0073] In order to train the dimension text location recognition model, a large number of training images need to be obtained as training samples. However, manually labeling the bounding box and corresponding tower dimension text of each training image is a time-consuming and tedious task. Therefore, a diffusion model can be trained to generate training images:
[0074] Firstly, the freetype tool is used to randomly combine numbers, letters and decimal points of different font types to obtain a series of random numbers, letters and decimal points to simulate different text styles and arrangements. Then, the PIL library is used to render each random character into a digital image according to the specified font, font size, color and other parameters, thereby converting each random number into a corresponding digital image. The above processing can simulate the characteristics of dimensional text in tower engineering drawings and expand the number and diversity of training samples.
[0075] Then, fuzzy processing such as mean, median or Gaussian filtering is applied to each digital image, and Gaussian or salt and pepper noise is added to obtain the corresponding real interference digital image to simulate various environmental interferences encountered in the real world, such as blur, noise, etc.; then, each random number and the corresponding real interference digital image are input into the diffusion model to be trained. The goal of the diffusion model is to predict the corresponding interference digital image with random numbers as input. During the training process, according to the difference between each predicted interference digital image and the corresponding real interference digital image, the network parameters are continuously adjusted through optimization algorithms such as gradient descent until the third loss function converges to obtain the trained diffusion model. Through the trained diffusion model, the real tower size text can be used to generate interference digital images with real noise distribution. The generated data set is closer to the real world situation, so that the model has better coping ability when facing real tower engineering drawings. Compared with the traditional method of artificially adding noise, the diffusion model can more accurately simulate the interference factors in the real scene, which improves the authenticity of the synthetic data set.
[0076] It should be noted that the real dimension text of the tower engineering drawings has the following characteristics: (1) Many font types: Different projects have different requirements for dimension font types; (2) Simple text types: Most dimensions are composed of integers and decimals, and a small number of them have English letters; (3) Regular text direction: The direction of dimension text is mostly horizontal or vertical; (4) Geometric structure noise interference: There are not only dimension lines near the dimension text, but also geometric structure lines of the tower, both of which will interfere with the recognition of the dimension; (5) Image blur and resolution difference: Due to the influence of the environment and camera parameters, noise interference will appear in the image, and the resolution of different images will be different. By training the diffusion model, these characteristics are simulated in the generated training images through the freetype tool and PIL library processing, so as to improve the model's ability to accurately recognize the real tower dimension text.
[0077] Next, you need to generate training images through the diffusion model: obtain some real tower size text from existing real tower engineering drawings or other sources, and input each real tower text into the trained diffusion model to generate the corresponding interference text image. The diffusion model will generate images with noise and other interference factors based on the real tower text to increase the diversity and authenticity of the data, such as Figure 3As shown in FIG. 1 , some interference text images are generated based on the trained diffusion model in this embodiment; a blank image is prepared in advance, and an appropriate image size and resolution can be selected to ensure that the image has enough space to accommodate the interference text and bounding box generated subsequently; then, according to the preset bounding box range and the ratio of each interference text image, a corresponding blank bounding box is randomly generated in the blank image to ensure that the position and size of the bounding box can adapt to the embedding of each interference text image, and each interference text image is embedded in the corresponding blank bounding box respectively to ensure that the position and ratio of the interference text image and the bounding box are consistent to obtain the final training image.
[0078] Through the above steps, a series of training images with real tower dimension text and interference factors can be generated. These images can be used as training samples for the dimension text position recognition model to improve the accuracy and robustness of the model in real tower engineering drawings.
[0079] Compared with manually annotated training images, the generated training images do not need to be manually annotated, which can save a lot of time and labor costs. In addition, the generated training samples contain a variety of interference factors and noise, which can help the dimension text location recognition model better understand and adapt to these interference factors and noise in the real world, and improve the robustness and accuracy of the model.
[0080] Step S203: Input a number of training images into the pre-trained dimension text position recognition model respectively, so that the pre-trained dimension text position recognition model takes the training image as input and the various predicted bounding boxes in the training image as output for training, and during the training process, adjust the network parameters of the dimension text position recognition model according to the various predicted bounding boxes of each training image and the corresponding training bounding boxes until the second loss function converges to obtain a trained dimension text position recognition model.
[0081] For step S203, the several training images obtained in step S202 are respectively input into the dimension text position recognition model pre-trained in step S201. The model processes the input image and outputs predicted bounding boxes. These bounding boxes are used to locate the dimension text in the recognition image. The predicted bounding boxes are compared with the real bounding boxes in the training image, and a second loss function between the two is calculated. In this embodiment, the second loss function can be the mean absolute error (MAE) or the cross-entropy loss (Cross-Entropy Loss), etc. According to the value of the second loss function, the network parameters of the dimension text position recognition model are updated through the back propagation algorithm, so that the dimension text position recognition model can more accurately predict the bounding box, thereby improving the recognition accuracy of the dimension text position. The above steps are repeated for multiple epochs until the second loss function converges, that is, the model training is completed, and the trained dimension text position recognition model can be used for the recognition task of the dimension text position.
[0082] Step S3: extracting images corresponding to the positions of the dimension text boxes in the engineering drawings of the tower to be identified as target detection images;
[0083] For step S3, according to the position information of the extracted dimension text box, the image is cropped at the corresponding position in the original tower engineering drawing to be identified, and the cropped image is used as the target detection image. The target detection image obtained by cropping can reduce the size of the image area processed by the model, improve the operating efficiency of the model, and speed up the recognition speed, which has obvious advantages, especially in the scenario of large-scale drawing recognition.
[0084] Step S4: input the target detection image into the trained dimension text information recognition model, so that the dimension text information recognition model recognizes the dimension text information of the target detection image and obtains the first dimension text information corresponding to the target detection image.
[0085] For step S4, each target detection image obtained in step S3 is input into the trained dimension text information recognition model. The dimension text information recognition model first extracts features from the input image to capture various features of the dimension text in the image, such as lines, shapes, colors, etc., so as to provide effective information for subsequent text recognition.
[0086] The trained dimension text information recognition model contains a network structure for feature extraction and classification of dimension text. Through training, the model has learned the features of dimension text, and through the forward propagation process of the model, it converts the image into a high-dimensional feature vector, which represents the features of the dimension text information in the image.
[0087] Next, through the learned features, the dimension text information recognition model uses its trained text classifier or text recognizer to analyze and recognize the dimension text in the image. This process can be to recognize the category of the text through the text classifier, or to convert the text in the image into text information through the text recognizer. Finally, the model can obtain the first dimension text information corresponding to the target detection image.
[0088] The following is a detailed description of the training process of the dimension text information recognition model:
[0089] like Figure 4 As shown, the training process of the dimension text information recognition model includes the following steps:
[0090] Step S401: Acquire a SynthAdd data set, and input the SynthAdd data set into an initialized dimension text information recognition model for iterative training until the fourth loss function converges, thereby obtaining a pre-trained dimension text information recognition model;
[0091] For step S401, during the training process of the dimension text information recognition model, the model needs to be pre-trained using the SynthAdd dataset: first, before starting the training, a dimension text information recognition model needs to be initialized. This model includes a network structure for feature extraction and classification, but the weight parameters of the model are randomly initialized; then, the SynthAdd dataset is obtained as a training dataset for pre-training the dimension text information recognition model. It should be noted that the SynthAdd dataset is a synthetic dataset that includes image samples of various dimension texts and corresponding label information; then, the image samples and label information of the SynthAdd dataset are input into the Iterative training is performed in the initialized dimension text information recognition model. In each round of training, the image sample is input into the model, and the output result of the model is calculated by forward propagation. Then, the output result of the model is compared with the label information to calculate the fourth loss function. The weight parameters of the model are updated through back propagation and optimization algorithms, so that the model can gradually optimize and reduce the value of the fourth loss function. After multiple training rounds, the change of the loss function during the training process is observed. When the loss function converges, that is, the value of the loss function no longer changes significantly or changes slightly, it can be considered that the training process has reached a convergence state. When the fourth loss function converges, a pre-trained dimension text information recognition model is obtained. This pre-trained model can be used as the basic model in subsequent steps for further training and optimization to achieve more accurate and reliable dimension text information recognition.
[0092] Step S402: For each training image, each interference text image in the training image and the corresponding real tower text are respectively input into the pre-trained dimension text information recognition model, so that the pre-trained dimension text information recognition model is trained with the interference text image as input and the predicted tower text as output, and during the training process, the network parameters of the dimension text information recognition model are adjusted according to the predicted tower text and the corresponding real tower text until the fifth loss function converges, thereby obtaining a trained dimension text information recognition model.
[0093] For step S402, in order to train the dimension text information recognition model, for each training image, firstly extract each interference text image contained therein and use it as input data, and at the same time, extract the real pole tower text in the training image and use it as the corresponding label information; input each interference text image and the corresponding real pole tower text into the pre-trained dimension text information recognition model respectively, through forward propagation, the model converts the interference text image into the predicted pole tower text, and calculates the fifth loss function (cross entropy or mean square error) according to the difference between the predicted pole tower text and the real pole tower text of the model, and adjusts the network parameters of the dimension text information recognition model according to the value of the fifth loss function through back propagation and optimization algorithm, so that the model can gradually optimize and reduce the value of the fifth loss function. When the fifth loss function converges, that is, the value of the fifth loss function no longer changes significantly or changes slightly, it can be considered that the training process has reached a convergence state, and a trained dimension text information recognition model is obtained. After multiple rounds of training, the model has learned how to predict the pole tower text from the interference text image, and this trained model can be used for subsequent dimension text information recognition tasks.
[0094] In this embodiment, the size text information recognition model was trained for 5 rounds. Each batch processed 64 images, and the Adam optimizer was used as the optimization algorithm. The initial learning rate was set to 0.001, and stepLR was used to adjust the learning strategy. The maximum sequence recognition length was set to 30 to limit the length of the output text. As shown in Table 1, the model pre-trained using only the SynthAdd dataset achieved an accuracy of 81% on the text recognition task. The size text recognition results of this scheme are shown in Table 1. Figure 5 (a); however, when the pre-trained model is used together with the (tower) training images for training, the accuracy rate increases to 92%. The dimensional text recognition results of this scheme are shown in Figure 5 (b) shows that fine-tuning the model using pole tower training images can significantly improve the accuracy of dimensional text information recognition.
[0095] Table 1 Comparison of text recognition results
[0096]
[0097] In a preferred embodiment, after obtaining the first size text information corresponding to the target detection image, the method further includes:
[0098] Input the target detection image into the preset Clip large model, so that the Clip large model recognizes the size text information of the target detection image, and obtains the second size text information corresponding to the target detection image;
[0099] The repeated dimension text in the first dimension text information and the second dimension text information is used as the final dimension text information.
[0100] In a preferred embodiment, the method for recognizing dimension text of a transmission tower engineering drawing further includes:
[0101] Determine whether there is non-repeated size text in the first size text information and the second size text information. If so, send a check signal and output a corresponding target detection image. If not, do not perform any operation.
[0102] In one embodiment of the present invention, the target detection image obtained in step S3 is input into a preset Clip model, and the size text information of the target detection image is recognized using the Clip model to obtain the second size text information corresponding to the target detection image; then, the first size text information and the second size text information obtained in step S4 are compared to determine which size texts are repeated. Repeated size texts are texts that have been correctly recognized in the first recognition and have also been successfully recognized in the Clip model. These repeated size texts are considered to be the final size text information. This step, combined with the Clip model, helps to eliminate errors or omissions that may exist in the first recognition, thereby improving the accuracy and stability of size text recognition.
[0103] It should be noted that the Clip model is an advanced visual context understanding model that can link images with texts. By learning large-scale images and texts, it converts images into visual features and matches and compares them with existing text features to perform text recognition. By introducing the Clip model, we can use its powerful visual context understanding capabilities to improve the accuracy and reliability of dimensional text information.
[0104] In addition, confirm whether there is non-repeating dimension text in the first dimension text information and the second dimension text information. If there is non-repeating dimension text, it may mean that there is an error or omission in the recognition process. At this time, the system will send a check signal and output the corresponding target detection image for further inspection and correction. If there is no non-repeating dimension text in the first dimension text information and the second dimension text information, no operation is required.
[0105] like Figure 6 As shown, based on the above method embodiment, a corresponding device embodiment is provided;
[0106] An embodiment of the present invention provides a device for recognizing dimension text of a transmission tower engineering drawing, comprising: an engineering drawing acquisition module, a dimension text position recognition module, an image extraction module, and a dimension text information recognition module;
[0107] An engineering drawing acquisition module is used to acquire engineering drawings of the tower to be identified;
[0108] The dimension text position recognition module is used to input the pole tower engineering drawing to be recognized into the trained dimension text position recognition model, so that the dimension text position recognition model recognizes the dimension text position of the pole tower engineering drawing to be recognized, and obtains the position of each dimension text box in the pole tower engineering drawing to be recognized;
[0109] An image extraction module is used to extract images corresponding to the positions of the dimension text boxes in the engineering drawings of the tower to be identified as target detection images;
[0110] The dimension text information recognition module is used to input the target detection image into the trained dimension text information recognition model so that the dimension text information recognition model recognizes the dimension text information of the target detection image and obtains the first dimension text information corresponding to the target detection image.
[0111] It can be understood that the above-mentioned device item embodiment corresponds to the method item embodiment of the present invention, which can implement the method for recognizing the dimension text of the transmission tower engineering drawing provided by any one of the above-mentioned method item embodiments of the present invention.
[0112] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art may understand and implement the present invention without creative work.
[0113] Based on the above-mentioned embodiment of the method for recognizing dimensional text of transmission tower engineering drawings, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method for recognizing dimensional text of transmission tower engineering drawings of any embodiment of the present invention is implemented.
[0114] Exemplarily, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more module elements may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.
[0115] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0116] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0117] Based on the above method embodiment, another embodiment is provided: another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for identifying the dimension text of the transmission tower engineering drawing described in any one of the above method embodiments of the present invention.
[0118] Wherein, the module / unit integrated in the device / terminal device for identifying the dimension text of the transmission tower engineering drawing, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0119] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for recognizing dimension text of transmission tower engineering drawings, characterized in that: include: Obtain engineering drawings of the tower to be identified; Inputting the pole tower engineering drawing to be identified into the trained dimension text position recognition model, so that the dimension text position recognition model recognizes the dimension text position of the pole tower engineering drawing to be identified, and obtains the position of each dimension text box in the pole tower engineering drawing to be identified; Extract the image corresponding to the position of each dimension text box in the engineering drawing of the tower to be identified as the target detection image; The target detection image is input into a trained dimension text information recognition model, so that the dimension text information recognition model recognizes the dimension text information of the target detection image to obtain the first dimension text information corresponding to the target detection image.
2. The method for recognizing dimension text of transmission tower engineering drawings according to claim 1, characterized in that: After obtaining the first size text information corresponding to the target detection image, the method further includes: Inputting the target detection image into a preset Clip large model, so that the Clip large model recognizes the size text information of the target detection image, and obtains the second size text information corresponding to the target detection image; The repeated dimension text in the first dimension text information and the second dimension text information is used as the final dimension text information.
3. The method for recognizing dimension text of transmission tower engineering drawings according to claim 2 is characterized in that: Also includes: Determine whether there is non-repeated dimension text in the first dimension text information and the second dimension text information. If so, send a check signal and output a corresponding target detection image. If not, do not perform any operation.
4. The method for recognizing dimension text of transmission tower engineering drawings according to claim 1, characterized in that: The dimension text position recognition model is trained in the following way: Obtain an ImageNet dataset, and input the ImageNet dataset into an initialized size text position recognition model for iterative training until a first loss function converges, thereby obtaining a pre-trained size text position recognition model; Acquire a plurality of training images; wherein each training image comprises a plurality of training bounding boxes and corresponding real tower texts; Several training images are respectively input into the pre-trained dimension text position recognition model, so that the pre-trained dimension text position recognition model takes the training image as input and the various predicted bounding boxes in the training image as output for training, and during the training process, the network parameters of the dimension text position recognition model are adjusted according to the various predicted bounding boxes of each training image and the corresponding training bounding boxes until the second loss function converges to obtain the trained dimension text position recognition model.
5. The method for recognizing dimension text of transmission tower engineering drawings according to claim 4, characterized in that: The training image is obtained by: Obtain a blank image and a random number of real tower texts; Input each real pole tower text into the trained diffusion model, so that the diffusion model generates a corresponding interference text image according to each real pole tower text; According to a preset border range and a ratio of each interfering text image, randomly generating a corresponding blank boundary box in the blank image; Each interference text image is embedded in the corresponding blank bounding box to obtain a training image.
6. The method for recognizing dimension text of transmission tower engineering drawings according to claim 5, characterized in that: The diffusion model is trained in the following way: Use the freetype tool to randomly combine numbers, letters, and decimal points of different font types to obtain a number of random numbers; Convert each random number into a corresponding digital image through the PIL library; Each digital image is blurred by using mean, median or Gaussian filtering, and Gaussian or salt and pepper noise is added to obtain the corresponding real interference digital image; Each random number and the corresponding real interference digital image are input into the diffusion model to be trained, so that the diffusion model takes the random number as input and the predicted interference digital image as output, and during the training process, the network parameters of the diffusion model are adjusted according to each predicted interference digital image and the corresponding real interference digital image until the third loss function converges to obtain the trained diffusion model.
7. The method for recognizing dimension text of transmission tower engineering drawings according to claim 6, characterized in that: The dimension text information recognition model is trained in the following way: Acquire a SynthAdd data set, and input the SynthAdd data set into an initialized dimension text information recognition model for iterative training until the fourth loss function converges, thereby obtaining a pre-trained dimension text information recognition model; For each training image, each interference text image in the training image and the corresponding real tower text are respectively input into the pre-trained dimension text information recognition model, so that the pre-trained dimension text information recognition model is trained with the interference text image as input and the predicted tower text as output, and during the training process, the network parameters of the dimension text information recognition model are adjusted according to the predicted tower text and the corresponding real tower text until the fifth loss function converges, thereby obtaining the trained dimension text information recognition model.
8. A device for recognizing dimension text of transmission tower engineering drawings, characterized in that: include: Engineering drawing acquisition module, dimension text position recognition module, image extraction module, and dimension text information recognition module; The engineering drawing acquisition module is used to acquire the engineering drawings of the tower to be identified; The dimension text position recognition module is used to input the pole tower engineering drawing to be recognized into the trained dimension text position recognition model, so that the dimension text position recognition model recognizes the dimension text position of the pole tower engineering drawing to be recognized, and obtains the position of each dimension text box in the pole tower engineering drawing to be recognized; The image extraction module is used to extract the image corresponding to the position of each dimension text box in the tower engineering drawing to be identified as the target detection image; The dimension text information recognition module is used to input the target detection image into the trained dimension text information recognition model, so that the dimension text information recognition model recognizes the dimension text information of the target detection image and obtains the first dimension text information corresponding to the target detection image.
9. A terminal device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for recognizing dimension text of a transmission tower engineering drawing as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: include: A stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for recognizing the dimension text of the transmission tower engineering drawing as described in any one of claims 1 to 7.
Citation Information
Cited By
Method and device for automatically detecting automobile drawing size marking by intelligent computing cloud platform through computing power
CN121392887A