A method for identifying geometric tolerances in mechanical drawings based on data generation.

By constructing text templates and stitching together blocks to generate geometric tolerance images, and using SVTR neural networks for transfer training, the problems of large discrepancies between generated results and actual values ​​and high manual costs in existing technologies are solved, achieving high-precision geometric tolerance recognition of mechanical drawings.

CN121281086BActive Publication Date: 2026-05-26ZHEJIANG UNIV CITY COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV CITY COLLEGE
Filing Date
2025-12-09
Publication Date
2026-05-26

Smart Images

  • Figure CN121281086B_ABST
    Figure CN121281086B_ABST
Patent Text Reader

Abstract

This invention relates to a method for recognizing geometrical tolerances (GMPs) in mechanical drawings based on data generation. The method includes: generating a GMP image-text dataset through text template construction, similar character replacement, appearance parameter randomization, block stitching, and image enhancement; performing transfer training of a recognition model based on the GMP image-text dataset; inputting the GMP image of the mechanical drawing to be recognized into the recognition model, and outputting the analytical results. The advantages of this invention are: it only uses generated data for training, eliminating the need for real data and saving on manual annotation costs; and it allows for flexible adjustment of parameters such as font style, font spacing, and border width during generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of mechanical drawing character recognition technology, and particularly relates to a method for recognizing geometric tolerances in mechanical drawings based on data generation. Background Technology

[0002] Geometric tolerances (GPTs) are a standard system used in mechanical drawings to indicate the geometry, dimensions, and relative positions of parts. They are a crucial part of modern mechanical design and manufacturing. GPTs are typically represented in the form of a grid, containing the tolerance type, numbers, letters, and other symbols. Figure 1 As shown. The content of the boxes, from left to right, is as follows: the first box is the geometric tolerance type symbol, the second box is the tolerance zone shape and tolerance value, and the third and subsequent boxes are the annotation datum. Sometimes, the boxes containing the tolerance value and the annotation datum are accompanied by a "..." label. "or" Additional condition symbols such as "".

[0003] Geometric tolerances, as key information in mechanical drawings, need to be accurately identified and interpreted during the production and inspection of mechanical products. Compared with traditional manual interpretation, using existing recognition neural network methods (such as CRNN) for geometric tolerance identification is faster and more efficient, but it still faces challenges such as difficulty in obtaining training data and complex data annotation.

[0004] The thickness of the grid lines, font size, and spacing between characters and grid lines in mechanical drawings can vary significantly depending on the drafting standard. Furthermore, different countries and companies often use inconsistent drafting standards, leading to a diversity in the appearance of geometric tolerances in mechanical drawings. Additionally, due to issues such as uneven lighting, low resolution, and noise interference that may exist in scanned mechanical drawings, the appearance of geometric tolerances may not be identical even under the same drafting standard. (See attached document for details.) Figure 3 Due to the diversity and differences in actual situations, generating training data that simulates real geometric tolerances is quite challenging.

[0005] There are two main existing methods for generating geometric tolerance data, but both have significant shortcomings:

[0006] (1) Static symbol rendering method: Some font libraries provide geometric tolerance symbols, numbers and letters with borders, which can be directly used to render geometric tolerance images. However, this method cannot adjust details such as character spacing, border thickness and length during the generation process, and the appearance of the generated geometric tolerances is significantly different from the geometric tolerances in the actual mechanical drawings, making it unsuitable for use as training data for recognition neural networks.

[0007] (2) Frame Masking Generation Method: First, collect real geometric tolerance images, and then use randomly generated character images to mask the original characters within the frames of the geometric tolerance, thereby generating a new geometric tolerance image. Although the geometric tolerance image generated by this method is closer to the real situation than the "static symbol rendering method", this method not only requires the manual collection of a certain number of real geometric tolerance images, but also requires frame positioning and character image replacement during the generation process. The whole process is cumbersome and time-consuming.

[0008] In summary, the existing methods have obvious shortcomings in generating geometric tolerance data: Method (1) can automatically generate data, but the results are significantly different from the real data and have a single style, making it difficult to simulate geometric tolerances under different mechanical drawing standards; Method (2) can generate high-quality data, but requires high labor costs. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for identifying geometric tolerances in mechanical drawings based on data generation.

[0010] Firstly, a method for identifying geometric tolerances in mechanical drawings based on data generation is provided, including:

[0011] Step 1: By constructing a text template with frame delimiters, random replacement of the same type of characters generates geometric tolerance text. Randomize the appearance parameters of the geometric tolerance image to be generated, use tile stitching technology to generate the internal region image, add an outer border and perform image enhancement to generate the geometric tolerance image-text dataset.

[0012] Step 2: Based on the geometric tolerance image-text dataset, perform transfer training of the recognition model;

[0013] Step 3: Input the geometric tolerance image of the mechanical drawing to be identified into the identification model and output the analysis results.

[0014] Preferably, step 2 includes:

[0015] Step 2.1: Pre-train the feature extraction layer of the recognition model on a public character dataset;

[0016] Step 2.2: Freeze the feature extraction layer and use the geometric tolerance image-text dataset to perform targeted optimization of the high-level semantic module of the recognition model.

[0017] Preferably, in step 1, the appearance parameters of the geometric tolerance image include font size, font color, outer border and grid dividing line width, and character spacing width.

[0018] Preferably, in step 1, the image enhancement includes noise injection, stretching and compression, and adding Gaussian blur.

[0019] Preferably, in step 2.1, the recognition model is an SVTR neural network.

[0020] Secondly, a data-generated mechanical drawing form and position tolerance recognition system is provided for performing any of the methods described in the first aspect, including:

[0021] The generation module is used to generate geometric tolerance text by constructing a text template with frame delimiters, randomly replacing the same type of characters, randomizing the appearance parameters of the geometric tolerance image to be generated, generating an internal region image by using tile stitching technology, adding an outer border and then enhancing the image to generate a geometric tolerance image-text dataset.

[0022] The training module is used to perform transfer training of the recognition model based on the geometric tolerance image-text dataset.

[0023] The output module is used to input the geometric tolerance image of the mechanical drawing to be identified into the recognition model and output the analysis result.

[0024] Thirdly, a computer storage medium is provided, wherein a computer program is stored therein; when the computer program is run on a computer, the computer causes the computer to perform any of the methods described in the first aspect.

[0025] Fourthly, an electronic device is provided, comprising:

[0026] Memory, used to store computer programs;

[0027] A processor for executing the computer program to implement the method as described in any of the first aspects.

[0028] The beneficial effects of this invention are:

[0029] 1. This invention uses only generated data for training, without requiring real data to train the model, thus eliminating the cost of manual annotation.

[0030] 2. The geometric tolerance generation method provided by this invention allows for flexible adjustment of parameters such as font style, font spacing, and border width during generation, enabling the generated geometric tolerances to cover the appearance requirements of different drafting standards such as GB / T 1182-2018 and ASME Y14.5 for geometric tolerances in mechanical drawings.

[0031] 3. In this invention, the model is pre-trained on a publicly available character recognition dataset and then fine-tuned on a geometric tolerance dataset, which improves the training speed of the model, enables the model to effectively learn the fine-grained features of real character images, and effectively improves the model's recognition accuracy of real geometric tolerances. Attached Figure Description

[0032] Figure 1 This is an example diagram showing the composition and symbol types of geometric tolerances;

[0033] Figure 2 This is a schematic diagram of the area division of geometric tolerances in this invention;

[0034] Figure 3 These are diverse visual representations of the geometric tolerances in actual drawings;

[0035] Figure 4 This is a schematic diagram of the actual geometric tolerances and the corresponding geometric tolerance text template.

[0036] Figure 5 This is a schematic diagram of the process for generating training data for geometric tolerances;

[0037] Figure 6 This is a flowchart of the character block generation process;

[0038] Figure 7 It is a schematic diagram of the internal area of ​​the splicing geometric tolerance and the appearance of each block in it;

[0039] Figure 8 This is a schematic diagram showing the addition of an outer border to the internal area of ​​geometric tolerances;

[0040] Figure 9 This is a schematic diagram of the SVTR network structure;

[0041] Figure 10 This is a schematic diagram of the geometric tolerance image generated by this method. Detailed Implementation

[0042] The present invention will be further described below with reference to embodiments. The description of the embodiments below is only for the purpose of helping to understand the present invention. It should be noted that those skilled in the art can make several modifications to the present invention without departing from the principle of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

[0043] Example 1:

[0044] To address the problems of existing technologies, Embodiment 1 of this application provides a method for identifying geometric tolerances in mechanical drawings based on data generation, including:

[0045] Step 1: Generate a geometric tolerance image-text dataset by constructing text templates, replacing characters of the same type, randomizing appearance parameters, stitching tiles, and enhancing images.

[0046] To facilitate the explanation of the geometric tolerance data generation process in this invention, the vertical line between two frames in the geometric tolerance is called the frame dividing line, the area containing the frame dividing line and the text within the frame is called the internal area of ​​the geometric tolerance, and the dark rectangular frame outside the internal area of ​​the geometric tolerance is called the outer border of the geometric tolerance. Figure 2 As shown. The process for generating geometric tolerance data in this invention is described in [reference needed]. Figure 5 ,include:

[0047] Step 1.1: Create a geometric tolerance text template with framed dividers.

[0048] Specifically, following a left-to-right order, the text content within each frame of the geometric tolerances on the mechanical drawings is manually collected. A special symbol (defined as a frame separator) is used as a connector to link the content from different frames from left to right into a single string. This string simultaneously records the position information of each frame and its internal text content. See the example below. Figure 4 This string is defined as a geometric tolerance text template for subsequent steps.

[0049] For example, to ensure that the generated geometric tolerances more closely resemble reality, this invention may optionally perform statistical analysis on a small number of mechanical drawings before generating the data. For instance, 500 geometric tolerance images may be extracted from 50 mechanical drawings and used only to analyze features such as font type, frame layout, and parameter value range, rather than directly using these real images for model training.

[0050] During the analysis, for each geometric tolerance, the text content in each frame is extracted from left to right, and the text content in each frame is connected using frame delimiters to generate a structured string, which is defined as the geometric tolerance text template (see example). Figure 4 All generated geometric tolerance text templates are stored uniformly in a string list, namely the geometric tolerance text template list. This invention uses " The symbol "(Unicode code 0x280A)" is used as the frame separator because it does not conflict with any of the possible characters in the actual geometric tolerance.

[0051] Step 1.2: Randomly replace characters of the same type in the form and position tolerance text template to generate form and position tolerance text.

[0052] Specifically, the geometric tolerance text template string obtained in step 1.1 is randomly replaced with characters of the same type (such as the geometric tolerance type symbol and the tolerance band shape symbol), so that the generated geometric tolerance text data content is different and meets the format requirements of the actual geometric tolerance text.

[0053] For example, the template string is randomly replaced with characters according to the character replacement types and rules shown in Table 1, while keeping the frame separators and other types of symbols (such as "+", "-", "[") in the template string unchanged during the replacement process. Using the above replacement method, geometric tolerance text data with different text content can be generated, and it is ensured that all generated text conforms to the format requirements of actual geometric tolerances, thereby obtaining enhanced geometric tolerance text data.

[0054] Table 1

[0055]

[0056] Step 1.3: Randomize the appearance parameters of the geometric tolerance image to be generated.

[0057] Specifically, the appearance of the geometric tolerance image is controlled by a set of configurable parameters (including font size, color, outer border width, character spacing, etc.), which are defined as geometric tolerance appearance parameters. The specific definitions, preset value ranges, and technical effects of the geometric tolerance appearance parameters are shown in Table 2. During generation, the specific values ​​of the parameters are randomly selected within their preset range. This range is derived from the statistical analysis in step 1.1 to ensure that the generated geometric tolerance appearance closely approximates the actual situation. Since the geometric tolerance images generated in this method are all grayscale images, parameters involving color (such as font color and border color) are all represented by grayscale values ​​(ranges are shown in Table 2).

[0058] Table 2

[0059]

[0060] Step 1.4: Generate the internal area block of geometric tolerances.

[0061] Specifically, such as Figure 2 As shown, the internal area image of geometric tolerances can be pieced together from left to right by different character blocks, blank blocks, and other image blocks. Based on the geometric tolerance appearance parameters in step 1.3, determine the size, color, and other characteristics of the blocks, and draw all the blocks.

[0062] For example, the internal area of ​​geometric tolerances (reference) Figure 3 (Can be derived from character blocks) Blank blocks and Frame dividing line block It is assembled by alternating pieces in a specific order (see reference) Figure 7 The definition and function of the internal area blocks for geometric tolerances are shown in Table 3.

[0063] Table 3

[0064]

[0065] This step aims to generate all the tiles needed for stitching. The specific steps are as follows:

[0066] First, generate the character tile and calculate its height. Render the geometric tolerance text (after removing the grid separators) as an image. Rendering The font style, font color, and font size used have been determined in step 1.3. The size is .Will Paste to size On the white image, the paste location is Get the image Then according to The bbox width of each character in the image Segmented into multiple image blocks containing a single character .in This refers to the total number of symbols in the geometric tolerance text, excluding frame separators; that is, the number of character blocks. The width of each character block is the bbox width of the corresponding character. And highly unified as:

[0067]

[0068] in For character tile width, The largest bbox height among all characters. and These represent the spacing between the characters and the outer border.

[0069] Then other tiles are generated, including:

[0070] Height is Width is White blank tile ;

[0071] Height is Width is The color is white blank tile ;

[0072] Height is Width is The grid dividing line tile with random grayscale values. .

[0073] Appearance reference for all the above blocks Figure 7 .

[0074] Step 1.5: Splice the blocks to generate an image of the internal area of ​​geometric tolerances.

[0075] Specifically, based on the order of characters and frame dividing symbols in the corresponding geometric tolerance text, all blocks are stitched together to generate an image of the internal area of ​​the geometric tolerance.

[0076] For example, such as Figure 7 As shown, the block , , , The splicing rules are as follows:

[0077] (1) The character block order is consistent with the character order in the corresponding geometric tolerance text, among which the frame dividing line block The position of the frame divider symbol in the geometric tolerance text is consistent with the position of the frame divider symbol.

[0078] (2) A tile is spliced ​​before the character tile corresponding to the first character and after the character tile corresponding to the last character. , represents the blank area between the character and the outer border.

[0079] (3) In the geometric tolerance text, splice the blocks between the character blocks corresponding to adjacent characters. , represents the whitespace area between characters.

[0080] (4) In the grid dividing line block Add with adjacent character blocks , represents the blank area between the character and the frame dividing line.

[0081] Based on the above stitching rules, generate the internal image of geometric tolerances. The obtained image of the internal region of geometric tolerances. The size is .

[0082] Step 1.6: Add an outer border to form a complete geometric tolerance image.

[0083] Specifically, a border is drawn outside the internal region image generated in step 1.5 to form a complete geometric tolerance image.

[0084] For example, draw a size of The color is dark rectangle (in and All are geometrical tolerance appearance parameters (see Table 2). Images of the internal areas of the geometrical tolerances are shown. Paste into dark rectangle Above, the paste location is ( , This yields a complete geometric tolerance image including the outer border. The process is as follows: Figure 8 As shown.

[0085] Step 1.7: Perform image enhancement on the geometric tolerance image.

[0086] In step 1.7, the image enhancement includes noise injection, stretching and compression, and adding Gaussian blur to simulate real-world scenarios such as paper aging and scanning distortion, making the generated data more diverse and closer to reality.

[0087] For example, first, with a 30% probability, one of the following three perturbations is applied to the image: Gaussian noise, salt-and-pepper noise, or Gaussian blur. Then, with a 30% probability, the image undergoes one of the following geometric transformations: slight rotation, horizontal stretching, or compression. After these processes, the enhanced geometric tolerance image data is obtained.

[0088] Step 1.8: Using the geometric tolerance text as the truth label, pair it with the geometric tolerance image to construct a geometric tolerance image-text dataset.

[0089] Specifically, the geometric tolerance text generated in step 1.2 is used as the ground truth label and paired with the corresponding image to construct a training dataset. Since the labels in this training dataset retain the frame segmentation symbols, the trained recognition model can effectively distinguish the text content within different frames. The final geometric tolerance image generated by this invention is shown below. Figure 10 As shown, the appearance is close to the actual geometric tolerances.

[0090] Step 2: Based on the geometric tolerance image-text dataset, perform transfer training of the recognition model.

[0091] Step 3: Input the geometric tolerance image of the mechanical drawing to be identified into the identification model and output the analysis results.

[0092] Example 2:

[0093] Based on Example 1, Example 2 of this application provides a more specific method for identifying geometric tolerances in mechanical drawings based on data generation, including:

[0094] Step 1: Generate a geometric tolerance image-text dataset by constructing text templates, replacing characters of the same type, randomizing appearance parameters, stitching tiles, and enhancing images.

[0095] Step 2: Based on the geometric tolerance image-text dataset, perform transfer training of the recognition model.

[0096] Step 2 includes:

[0097] Step 2.1: Pre-train the feature extraction layer of the recognition model on a public character dataset.

[0098] Specifically, a basic recognition model is pre-trained on a public character recognition dataset to enable the model's feature extraction layer to grasp the fine-grained features of real characters (such as stroke structure, anti-aliased edges, etc.). The core objective of this pre-training process is to lay the foundation for meeting the actual engineering needs in the future. The model selection is mainly based on the following three engineering needs: (1) In view of the large number of geometric tolerance annotations in machining drawings, in order to ensure the overall processing efficiency of the drawings, the recognition model must have efficient single annotation recognition capabilities and be able to achieve rapid recognition; (2) In order to facilitate the integration of this recognition method into the existing mechanical design and manufacturing management software system, the recognition model needs to control the scale of parameters to reduce the cost of occupying hardware resources of the software running equipment; (3) Considering that machining drawings are prone to complex distortions such as blurring and tilting in actual circulation (such as scanning and transmission), the recognition model must have robust high-precision recognition performance. Based on the above requirements, by comparing the accuracy, speed and parameter indicators of different recognition models on the public OCR dataset (see Table 4 for details), this method selects the SVTR network as the recognition model in specific implementation. Compared to methods such as CRNN and ABINet, this model not only has fewer parameters and runs faster, but also maintains high recognition accuracy, which can fully meet the application requirements of practical engineering scenarios.

[0099] Table 4

[0100]

[0101] Among them, IC13, SVT, IIIT5k, IC15, SVTP, and CUTE are public OCR datasets. CRNN [Shi et al., 2017], Rosetta [Borisyuk et al., 2018], SRN* [Yu et al., 2020], PREN* [Yan et al., 2021], VITSTR [Atienza, 2021], ABINet* [Fang et al., 2021], VST* [Tang et al., 2022], ASTER [Shi et al., 2021] al., 2019], MORAN [Luo et al., 2019], NRTR [Sheng et al., 2019], SAR [Li et al., 2019], AutoSTR [Zhang et al., 2020], SRN [Yu et al., 2020], PREN2D [Yanet al., 2021], VisionLAN [Wang et al., 2020] al.,2021], ABINet [Fang et al. [al., 2021] and VST [Tang et al., 2022] are existing recognition methods. SVTR-T (Tiny), SVTR-S (Small), SVTR-B (Base), and SVTR-L (Large) are recognition methods based on SVTR networks with progressively increasing parameter counts provided in this application.

[0102] The preferred recognition model is an SVTR neural network, the network structure of which is as follows: Figure 9 As shown, the network structure consists of three parts:

[0103] (1) Feature extraction layer: PPLCNetV3 is used as the backbone network, and key feature information in character images is extracted through depthwise separable convolution and multi-stage downsampling.

[0104] (2) Feature fusion layer: Contextual information is fused through local attention and global attention mechanisms, and feature alignment is achieved using lightweight convolution and feature dimension compression modules.

[0105] (3) Output layer: The extracted features are aligned into a character sequence using the CTC (Connectionist Temporal Classification) output header, and the recognition results are output.

[0106] The training preparation phase of the recognition model includes:

[0107] (1) Character mapping dictionary: used to map the model output category index to characters, using a text file with one character per line. The content includes 26 English letters (uppercase and lowercase), numbers, common punctuation marks, mathematical symbols and special symbols related to geometric tolerances.

[0108] (2) Optimizer type: Adam optimizer is used. The configuration parameters are 0.9 for the first moment decay rate and 0.999 for the second moment decay rate.

[0109] (3) Learning rate strategy: Cosine annealing is used as the learning rate adjustment strategy during training, and the initial learning rate is set to 0.0001.

[0110] (4) Regularization: Use L2 weight decay with a coefficient of 3.0e-05 to prevent the model from overfitting.

[0111] (3) Loss function calculation: The CTC (Connectionist Temporal Classification) loss function is used to calculate the loss value during pre-training and freeze-tuning training. The CTC loss function is defined as:

[0112]

[0113] in, Indicates all possible alignment paths, Represents all sequences mapped to character labels. The set of paths.

[0114] Subsequently, 1 million images were extracted from the publicly available character datasets MJ Synth and SynthText, and divided into training and test sets in an 8:2 ratio. The training run consisted of 1000 epochs, with a batch size of 192.

[0115] Step 2.2: Freeze the feature extraction layer and use the geometric tolerance image-text dataset to perform targeted optimization of the high-level semantic module of the recognition model.

[0116] For example, 100,000 geometric tolerance images were synthesized using the method of this invention and divided into training and test sets in an 8:2 ratio. During fine-tuning, the feature extraction layer in the SVTR-T model was frozen, and only the remaining parts were trained. The training epochs were 500, and the batch size was also set to 192.

[0117] The model trained using the above process can quickly and accurately identify geometric tolerances in mechanical drawings with different styles. During model training, all geometric tolerance data used was obtained through data generation, avoiding manual data annotation and effectively reducing training costs.

[0118] Step 3: Input the geometric tolerance image of the mechanical drawing to be identified into the identification model and output the analysis results.

[0119] To verify the effectiveness of this invention, multiple datasets were constructed by generating 30,000 samples from different geometric tolerance image generation methods. Based on these datasets, a pre-trained SVTR-T model was trained on each dataset, and prediction tests were conducted on 500 real geometric tolerance images to evaluate the model's recognition accuracy. Table 4 shows a comparison of the model's prediction performance on real data under different generation methods. Experimental results show that the recognition model trained using the data generated by the method of this invention has higher accuracy on real geometric tolerance images, effectively verifying the feasibility and superiority of this invention.

[0120] Table 5

[0121]

[0122] It should be noted that the parts in this embodiment that are the same as or similar to those in Embodiment 1 can be referred to each other, and will not be repeated in this application.

[0123] Example 3:

[0124] Based on Embodiment 2, Embodiment 3 of this application provides a data-generated mechanical drawing form and position tolerance recognition system, including:

[0125] The generation module is used to generate geometric tolerance text by constructing a text template with frame delimiters, randomly replacing the same type of characters, randomizing the appearance parameters of the geometric tolerance image to be generated, generating an internal region image by using tile stitching technology, adding an outer border and then enhancing the image to generate a geometric tolerance image-text dataset.

[0126] The training module is used to perform transfer training of the recognition model based on the geometric tolerance image-text dataset.

[0127] The output module is used to input the geometric tolerance image of the mechanical drawing to be identified into the recognition model and output the analysis result.

[0128] It should be noted that the system provided in this embodiment is the corresponding system of the method provided in embodiment 2. Therefore, the parts that are the same as or similar to those in embodiment 2 in this embodiment can be referred to each other, and will not be described again in this application.

[0129] In summary, this application can efficiently generate geometric tolerance images that closely resemble real-world scenarios, thus achieving ideal recognition accuracy using only the generated data during training. This method completely avoids the cost of manual annotation and enables high-precision recognition of geometric tolerances in mechanical drawings.

Claims

1. A method for identifying geometric tolerances in mechanical drawings based on data generation, characterized in that, include: Step 1: By constructing a text template with frame delimiters, random replacement of similar characters generates geometric tolerance text. The appearance parameters of the geometric tolerance image to be generated are randomized. A patchwork technique is used to generate an internal region image, which is composed of character patches, blank patches, and frame delimiter patches arranged alternately in a specific order. An outer border is added, and image enhancement is performed to generate a geometric tolerance image-text dataset. In Step 1, frame delimiters are used to connect the text content in each frame to generate a structured string. The structured string is used to record the position information of each frame and its internal text content, and is defined as a geometric tolerance text template. Step 2: Based on the geometric tolerance image-text dataset, perform transfer training of the recognition model; Step 3: Input the geometric tolerance image of the mechanical drawing to be identified into the recognition model, and output a structured string containing frame segmentation symbols as the recognition result.

2. The method for identifying geometric tolerances in mechanical drawings based on data generation according to claim 1, characterized in that, Step 2 includes: Step 2.1: Pre-train the feature extraction layer of the recognition model on a public character dataset; Step 2.2: Freeze the feature extraction layer and use the geometric tolerance image-text dataset to perform targeted optimization of the high-level semantic module of the recognition model.

3. The method for identifying geometric tolerances in mechanical drawings based on data generation according to claim 2, characterized in that, In step 1, the appearance parameters of the geometric tolerance image include font size, font color, outer border and grid dividing line width, and character spacing width.

4. The method for identifying geometric tolerances in mechanical drawings based on data generation according to claim 3, characterized in that, In step 1, the image enhancement includes noise injection, stretching and compression, and adding Gaussian blur.

5. The method for identifying geometric tolerances in mechanical drawings based on data generation according to claim 4, characterized in that, In step 2.1, the recognition model is an SVTR neural network.

6. A mechanical drawing form and position tolerance recognition system based on data generation, characterized in that, For performing the method according to any one of claims 1 to 5, comprising: The generation module is used to generate geometric tolerance text by constructing a text template with frame delimiters, randomly replacing the same type of characters, randomizing the appearance parameters of the geometric tolerance image to be generated, generating an internal region image by using tile stitching technology, adding an outer border and then enhancing the image to generate a geometric tolerance image-text dataset. The training module is used to perform transfer training of the recognition model based on the geometric tolerance image-text dataset. The output module is used to input the geometric tolerance image of the mechanical drawing to be identified into the recognition model and output the analysis result.

7. A computer storage medium, characterized in that, The computer storage medium stores a computer program; when the computer program is run on the computer, it causes the computer to perform the method described in any one of claims 1 to 5.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method as described in any one of claims 1 to 5.