Drawing identification model training data acquisition method and device and storage medium

By receiving drafting requests from drawing application accounts, generating target drawings, determining training data, and constructing training samples, the problem of low efficiency in acquiring training data for drawing recognition models is solved, achieving efficient and automated data acquisition and quality assurance.

CN121505656BActive Publication Date: 2026-04-28BEIJING EXPLORER SOFTWARE CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING EXPLORER SOFTWARE CORP LTD
Filing Date
2026-01-14
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the training data acquisition efficiency of drawing recognition models is low, resulting in low data acquisition efficiency.

Method used

By receiving drafting requests from drawing application accounts, target drawings are generated, and training input and output data are determined based on the drawing parameters to form training samples, which are then added to the training database to train the drawing recognition model.

Benefits of technology

It improves the efficiency of training data acquisition, ensures data quality consistency, reduces human error, and enhances the quality and acquisition speed of model training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505656B_ABST
    Figure CN121505656B_ABST
Patent Text Reader

Abstract

The application discloses a kind of drawing identification model training data acquisition method and device and storage medium. Among them, the method comprises: receiving drawing application account initiates the drawing request by target drawing application, wherein drawing request carries the drawing parameter for drawing drawing;In response to drawing request, generate target drawing based on drawing parameter;Determine training input data based on target drawing, and determine training output data based on drawing parameter;Training sample is added to training database by training input data and training output data, wherein the training sample in training database will be used to train drawing identification model, and drawing identification model is used to identify the drawing parameter corresponding to drawing from drawing.The application solves the technical problem that training data acquisition efficiency is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method, apparatus, and storage medium for acquiring training data for a drawing recognition model. Background Technology

[0002] In the construction, engineering, and manufacturing industries, efficiently extracting data from drawings is crucial for digital transformation. Currently, the acquisition of training data for building efficient drawing recognition models typically relies on manual annotation, leading to low data acquisition efficiency.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a method, apparatus, and storage medium for acquiring training data for a drawing recognition model, in order to at least solve the technical problem of low data acquisition efficiency.

[0005] According to one aspect of the embodiments of this application, a method for acquiring training data for a drawing recognition model is provided, comprising: receiving a drawing request initiated by a drawing application account through a target drawing application, wherein the drawing request carries drawing parameters for drawing a drawing; generating a target drawing based on the drawing parameters in response to the drawing request; determining training input data based on the target drawing and determining training output data based on the drawing parameters; adding training samples consisting of the training input data and the training output data to a training database, wherein the training samples in the training database are used to train a drawing recognition model, and the drawing recognition model is used to identify the drawing parameters corresponding to the drawing from the drawing.

[0006] According to another aspect of the embodiments of this application, a training data acquisition device for a drawing recognition model is also provided, comprising: a receiving unit, configured to receive a drawing request initiated by a drawing application account through a target drawing application, wherein the drawing request carries drawing parameters for drawing a drawing; a generating unit, configured to generate a target drawing based on the drawing parameters in response to the drawing request; a determining unit, configured to determine training input data based on the target drawing and determine training output data based on the drawing parameters; and an adding unit, configured to add training samples consisting of training input data and training output data to a training database, wherein the training samples in the training database will be used to train the drawing recognition model, and the drawing recognition model is used to identify the drawing parameters corresponding to the drawing from the drawing.

[0007] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for acquiring training data of the drawing recognition model at runtime.

[0008] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the training data acquisition method for the drawing recognition model described above.

[0009] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for acquiring training data of a drawing recognition model through the computer program.

[0010] In this embodiment, a drawing request initiated by a drawing application account through a target drawing application is received. The drawing request carries drawing parameters for drawing the drawing. In response to the drawing request, a target drawing is generated based on the drawing parameters. Training input data is determined based on the target drawing, and training output data is determined based on the drawing parameters. Training samples, consisting of the training input data and training output data, are added to a training database. These training samples are used to train a drawing recognition model, which identifies the corresponding drawing parameters from the drawing. This embodiment improves the efficiency of training data acquisition and solves the problem of low training data acquisition efficiency. Attached Figure Description

[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0012] Figure 1 This is a schematic diagram of an application environment for an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0013] Figure 2 This is a flowchart of an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0014] Figure 3 This is a schematic diagram of an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0015] Figure 4 This is another schematic diagram of an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0016] Figure 5 This is yet another schematic diagram of an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0017] Figure 6 This is yet another schematic diagram of an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0018] Figure 7 This is yet another schematic diagram of an optional method for acquiring training data for a drawing recognition model according to an embodiment of this application;

[0019] Figure 8 This is a schematic diagram of the structure of an optional drawing recognition model training data acquisition device according to an embodiment of this application;

[0020] Figure 9 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] According to one aspect of the embodiments of this application, a method for acquiring training data for a drawing recognition model is provided. Optionally, as an optional example, the above-described method for acquiring training data for a drawing recognition model is applied to, for example... Figure 1 In the environment shown. For example... Figure 1 As shown, the terminal device 102 includes a memory 104 for storing various data generated during its operation, a processor 106 for processing and calculating the aforementioned data, and a display 108 for displaying the drawing generation interface of the target drawing application. The terminal device 102 can interact with the server 112 via a network 110. The server 112 is connected to a database 114, which stores various data. The terminal device 102 can run the target drawing application.

[0024] Furthermore, the above method in Figure 1 The specific application process in the environment shown is as follows:

[0025] S102, when the drawing application account triggers a drawing generation operation in the drawing generation interface of the target drawing application, the terminal device 102 generates a drawing request carrying drawing parameters for drawing the drawing.

[0026] S104, terminal device 102 sends a mapping request to server 112 through network 110;

[0027] S106, Server 112 responds to the drawing request and generates the target drawing based on the drawing parameters;

[0028] S108, server 112 sends the target drawing to terminal device 102 through network 110;

[0029] S110, Terminal device 102 displays the target drawing in the drawing generation interface;

[0030] S112, server 112 determines training input data based on the target drawing and determines training output data based on the drawing parameters;

[0031] S114, server 112 adds training samples consisting of training input data and training output data to the training database. The training samples in the training database will be used to train the drawing recognition model, which will be used to identify the drawing parameters corresponding to the drawing from the drawing.

[0032] In this embodiment, a drawing request initiated by a drawing application account through a target drawing application is received. The drawing request carries drawing parameters for drawing the drawing. In response to the drawing request, a target drawing is generated based on the drawing parameters. Training input data is determined based on the target drawing, and training output data is determined based on the drawing parameters. Training samples, consisting of the training input data and training output data, are added to a training database. These training samples are used to train a drawing recognition model, which identifies the corresponding drawing parameters from the drawing. By integrating the drawing generation and data extraction processes, this embodiment ensures that each drawing generation is instantly converted into a training sample, eliminating the need for additional manual processing or secondary generation. This not only accelerates data accumulation but also reduces the possibility of human error through automation, ensuring the consistency of training data quality. In other words, this embodiment achieves the technical effects of improving the data quality of model training data and increasing the efficiency of training data acquisition, solving the technical problem of low training data acquisition efficiency.

[0033] Optionally, in this embodiment, the terminal device can be a terminal device configured with a target client, which may include, but is not limited to, at least one of the following: mobile phone (such as Android phone, iOS phone, etc.), laptop computer, tablet computer, PDA, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The target client may be a video client, instant messaging client, browser client, educational client, etc. The network may include, but is not limited to, wired network and wireless network, wherein the wired network includes: local area network, metropolitan area network and wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that enable wireless communication. The server may be a single server, a server cluster composed of multiple servers, or a cloud server. The above is only an example, and no limitation is made in this embodiment.

[0034] As an alternative solution, such as Figure 2 As shown, the training data acquisition method for the above drawing recognition model includes:

[0035] S202, Receive a drawing request initiated by the drawing application account through the target drawing application, wherein the drawing request carries drawing parameters for drawing the drawing;

[0036] S204, in response to a drafting request, generates the target drawing based on the drawing parameters;

[0037] S206, determine the training input data based on the target drawing, and determine the training output data based on the drawing parameters;

[0038] S208, add training samples consisting of training input data and training output data to the training database. The training samples in the training database will be used to train the drawing recognition model, which will be used to identify the drawing parameters corresponding to the drawing from the drawing.

[0039] Optionally, the aforementioned drawing recognition model can be, but is not limited to, representing a machine learning model, particularly a deep learning model, designed to identify and extract engineering parameter information from drawings. This model may be based on a Convolutional Neural Network (CNN), a Recurrent Neural Network (RNN), a Transformer (self-attention mechanism) model, or a combination thereof, or other network networks; this embodiment does not impose any limitations on this.

[0040] Specifically, let's take a drawing recognition model based on a convolutional neural network (CNN) as an example:

[0041] The model's structure includes a series of convolutional layers, activation functions, pooling layers, fully connected layers, and a final output layer. Convolutional layers capture local features of the input image, such as lines and shapes; activation functions like ReLU introduce non-linearity to help the model learn complex patterns; pooling layers, such as max pooling or average pooling, reduce spatial dimensionality and computational cost while preserving important features; fully connected layers map the extracted features to the model's output space, i.e., the drawing parameters; and the output layer provides the model's final prediction, typically using linear activation or a specific regression loss function to minimize prediction error.

[0042] Taking a drawing recognition model based on a recurrent neural network (RNN) as an example:

[0043] The model's structure includes: an input layer, one or more recurrent units (such as Long Short-Term Memory (LSTM) units or Gated Recurrent Units (GRUs), fully connected layers, and an output layer. The recurrent units are responsible for processing sequential data and can remember previously input information, which is particularly important for parsing annotation text in drawings and recognizing directional or continuous structural features. LSTMs and GRUs overcome the vanishing gradient problem in traditional RNNs by controlling the direction and magnitude of information flow, enabling them to process long sequences of data more effectively.

[0044] Taking a drawing recognition model based on Transformer as an example:

[0045] The model's structure includes: an encoder, a decoder, multi-head self-attention mechanisms, feed forward layers, layer normalization, and positional encoding. The encoder and decoder are responsible for feature extraction from the input data and generation of the output data, respectively. Multi-head self-attention is the core of the Transformer, allowing the model to focus on different positions of the input and calculate the correlations between them, which is crucial for capturing complex and discontinuous structural features on a drawing. Feed forward layers perform non-linear transformations to enhance the model's learning ability; layer normalization helps stabilize the training process; and positional encoding allows the model to understand the relative or absolute positions of the input sequence even without explicit order information.

[0046] Furthermore, the aforementioned drawing application account may be, but is not limited to, an account registered by the user on the drawing generation software or platform.

[0047] Optionally, the aforementioned target drawing application may, but is not limited to, refer to a specific software or application used to generate drawings. It is a platform where users request the generation of drawings and provides interfaces for receiving drafting requests and drawing parameters, as well as generating and saving target drawings.

[0048] It should be noted that the aforementioned drafting requests may include, but are not limited to, requests initiated by users through their drawing application accounts. These requests may contain detailed parameters required to draw a specific drawing, such as column dimensions and rebar configuration. The drafting request is the starting point of the entire process, triggering the creation of the drawing and the generation of subsequent training data. These parameters may include, but are not limited to, parameters entered by the user in the drawing generation interface and parameters recommended by the drawing application; however, this embodiment does not impose any limitations on these parameters.

[0049] Furthermore, the aforementioned drawing parameters may include, but are not limited to, the engineering attributes to be expressed in the drawings, such as structural dimensions, material specifications, and annotation information. This embodiment does not impose any limitations on these parameters. These parameters form the basis for generating the drawings and are also the output targets for model recognition.

[0050] Optionally, the target drawing mentioned above can be, but is not limited to, used to represent a drawing image generated based on drawing parameters provided by the user. It serves as the input data source in the training data acquisition method, used to train the model's ability to recognize drawing parameters.

[0051] It should be noted that the training input data mentioned above may include, but is not limited to, image information extracted from the target drawing. This information is typically converted into a format that the machine learning model can understand, such as a grayscale image matrix or pixel block information. This forms the basis for the model to learn and recognize the features of the drawing.

[0052] Furthermore, the aforementioned training output data may, but is not limited to, the numerical encoding of drawing parameters. It is used to guide the correct output of model prediction and is the target data in the model training process.

[0053] Optionally, the training samples described above may, but are not limited to, represent paired data points consisting of training input data and training output data. Each training sample is an instance in the model learning process, used to adjust the model parameters so that it can more accurately predict drawing parameters.

[0054] It should be noted that the aforementioned training database may include, but is not limited to, a collection storing all training samples for training machine learning models. It is the source of training data for the model; the more samples accumulated, the better the model training effect is generally.

[0055] Furthermore, the aforementioned drawing parameters (in the context of the training output data) may be, but are not limited to, structural attributes described in the engineering drawings, such as dimensions, material specifications, and annotations, which are encoded in digital form as the output of model training.

[0056] It should be noted that after generating the target drawing, the above drawing parameters and the target drawing can be, but are not limited to, as follows: Figure 3 As shown, it can be displayed in the drawing generation interface of the target drawing application.

[0057] It should be further noted that in some embodiments, such as Figure 4 As shown, the aforementioned target drawing application can also generate drawings in batches based on parameters. Accordingly, given the existence of batch parameters and batch drawings, batch training samples can be constructed using the batch drawing parameters and the batch drawings. In other words, the above drawing generation request may, but is not limited to, carry multiple sets of drawing parameters for generating multiple drawings. When generating drawings in response to the above drawing generation request, multiple target drawings may, but is not limited to, be generated based on multiple sets of drawing parameters, and thus multiple training samples can be constructed based on the multiple sets of drawing parameters and the multiple target drawings.

[0058] In this embodiment, a drawing request initiated by a drawing application account through a target drawing application is received. The drawing request carries drawing parameters for drawing the drawing. In response to the drawing request, a target drawing is generated based on the drawing parameters. Training input data is determined based on the target drawing, and training output data is determined based on the drawing parameters. Training samples, consisting of the training input data and training output data, are added to a training database. These training samples are used to train a drawing recognition model, which identifies the corresponding drawing parameters from the drawing. By integrating the drawing generation and data extraction processes, this embodiment ensures that each drawing generation is instantly converted into a training sample, eliminating the need for additional manual processing or secondary generation. This not only accelerates data accumulation but also reduces the possibility of human error through automation, ensuring the consistency of training data quality. In other words, this embodiment achieves the technical effects of improving the data quality of model training data and increasing the efficiency of training data acquisition, solving the technical problem of low training data acquisition efficiency.

[0059] As an optional approach, determining the training input data based on the target drawing includes:

[0060] Convert the target drawing into a grayscale image that matches the target drawing;

[0061] A grayscale image is segmented into multiple pixel blocks, and a target matrix is ​​created based on the multiple pixel blocks. Each element in the target matrix is ​​used to represent the pixel block information of the corresponding pixel block in the grayscale image.

[0062] The target matrix is ​​determined as the training input data.

[0063] It should be noted that the target drawing can be generated based on the graphic element group and the envelope position (the position occupied by the graphic) of each graphic element, or it can be obtained by taking a screenshot or printing the target drawing displayed in the drawing generation interface at a predetermined scale. This embodiment does not limit this.

[0064] Optionally, the aforementioned grayscale image refers to converting a color target drawing into an image format with only black and white grayscale levels. This conversion removes color information, simplifies the model's learning task, helps the model focus on key features such as shape and texture, and improves recognition performance, especially in the recognition of detailed engineering drawings.

[0065] Optionally, the grayscale image matched with the target drawing is used to indicate that the grayscale image and the original target drawing are consistent in content and structure, except that color information has been removed or simplified. This "matching" ensures that the information extracted from the grayscale image corresponds to the drawing parameters set by the user during drawing, maintaining data consistency and training effectiveness.

[0066] Optionally, the aforementioned multiple pixel blocks refer to dividing a grayscale image into a series of small image blocks, which can be, but are not limited to, squares or rectangles. Each pixel block contains information about all pixels within that region. This segmentation helps the model process local features of the image during training and enhances the model's ability to perceive features at different scales.

[0067] Optionally, the target matrix described above is a binary matrix composed of pixel block information. In this matrix, each row and column represents a pixel block at a corresponding location in the grayscale image, and each element of the matrix records the feature information of that pixel block, such as average brightness and texture. The target matrix provides a structured input format for the model, facilitating processing and feature extraction by deep learning models. For example, the target matrix described above can be, but is not limited to, as follows: Figure 5 The binary matrix shown.

[0068] Optionally, the aforementioned pixel block information refers to the statistical characteristics or descriptors of each pixel block, such as the average brightness, variance, and edge detection results of the pixel block. This information comprehensively describes the appearance features of the pixel block and is an important basis for model recognition and classification.

[0069] In this embodiment, the target drawing is converted into a grayscale image matching the target drawing; the grayscale image is segmented into multiple pixel blocks, and a target matrix is ​​created based on these pixel blocks, where each element in the target matrix represents the pixel block information of the corresponding pixel block in the grayscale image; the target matrix is ​​then used as the training input data. By converting the target drawing into a grayscale image and further segmenting it into pixel blocks to create a target matrix, this series of processes makes the input data more standardized and concise, helping to improve the training efficiency of the model. Grayscale images remove color information, reducing data dimensionality and lowering the training difficulty of the model. Pixel block segmentation and matrix processing fix the structure of the input data, facilitating the model's recognition and learning of feature patterns in the image. Simultaneously, matrix processing supports various neural network architectures, such as convolutional neural networks (CNNs), enhancing the model's versatility and applicability. Furthermore, this data preprocessing method helps the model generalize, enabling accurate recognition even when faced with drawings of different scales or sizes.

[0070] As an optional approach, determining the training output data based on drawing parameters includes:

[0071] According to the encoding format that matches the drawing recognition model, each parameter in the drawing parameters is encoded to obtain the encoding information that matches each parameter.

[0072] The encoded information that matches each parameter is used as the training output data.

[0073] It should be noted that the above encoding format may include, but is not limited to, various forms such as numeric encoding, character encoding, or mixed encoding, depending on the design and requirements of the model. For example, the column size "800x800" can be encoded as the number 800 twice, and the type of rebar (such as Φ25) can be encoded as a specific number or character to ensure that the model can correctly identify and process this information.

[0074] Furthermore, the aforementioned encoding process can, but is not limited to, be implemented as a data transformation process, converting drawing parameters that may originally be in text form into numerical or vector forms that machine learning models can understand. This approach helps the model accurately capture the numerical relationships between parameters, enabling effective feature extraction and pattern matching.

[0075] For example, the training output data can be constructed in the format of (parameter 1, parameter 2, ..., parameter N), such as (800, 800, 4Φ25, 6Φ20, 4Φ20, 4Φ25, Φ8100 / 200, 0, 0, 6, 6), where the steel bar symbols are already encoded as a character system, so the output data is converted into a numerical code. The encoding format used is the same as the encoding format used to solve the trained data model, where N is a positive integer greater than 2.

[0076] Optionally, the aforementioned "coded information matching each parameter" refers to the numerical or vector information obtained after encoding each drawing parameter. This information serves as the output target for model training and is directly related to the model's prediction results. For example, the column size is encoded as [800, 800], and the number of rebars is encoded as [4, 6], forming the "answer" for model training, which guides the model to learn how to accurately predict these parameters from the input image.

[0077] Optionally, in this embodiment, different parameters in the drawing parameters may be, but are limited to, having a relationship with different graphic elements in the target drawing, for example, such as Figure 6 As shown, different parameters are used to generate different graphic elements. When constructing sample data, the relationships between different graphic elements in the target drawing can be added to the sample data as auxiliary data for training input or output data, but are not limited to.

[0078] In this embodiment, each parameter in the drawing parameters is encoded according to an encoding format matching the drawing recognition model to obtain encoded information matching each parameter; this encoded information is then determined as the output data. By matching the encoding format with the model's input / output format, this embodiment ensures that the model can effectively understand and process this parameter information, avoiding training failures or poor performance due to data format mismatches. Encoding processing also eliminates redundant information between parameters, reducing noise interference during model training, which is beneficial for the model to accurately capture key parameter features and enhance its predictive ability. Furthermore, the use of encoded information allows the model to directly output highly readable numerical codes during prediction without complex post-processing steps, improving the efficiency of the entire recognition system.

[0079] As an optional solution, after generating the target drawing based on the drawing parameters in response to the drafting request, the following steps are also included:

[0080] Obtain the data authorization identifier carried in the drafting request. The data authorization identifier is used to indicate whether it is allowed to build training samples based on the target drawing and drawing parameters. The data authorization identifier is selected by the drawing application account in the drawing generation interface of the target drawing application.

[0081] If the data authorization identifier indicates that training samples cannot be built based on the target drawing and drawing parameters, then ignore the target drawing and drawing parameters.

[0082] Optionally, the above-mentioned drawing request may be, but is not limited to, a request action initiated by a user through a drawing application, with the purpose of generating a specific drawing, which usually contains specific parameters and design requirements required to draw the drawing.

[0083] It should be noted that the above-mentioned drafting request may include, but is not limited to, detailed information such as the drawing dimensions, material specifications, and layout mode input by the user. This information will guide the software on how to generate the drawing.

[0084] Furthermore, the aforementioned drawing parameters may include, but are not limited to, specific components and design details of the drawing, such as column dimensions, reinforcement arrangement, and stirrup spacing, which are essential input information for the software to generate drawings.

[0085] It should be noted that the aforementioned data authorization identifier may, but is not limited to, a flag set by the user to indicate whether the user agrees to use the target drawing and drawing parameters generated by their drafting request for model training. Furthermore, the aforementioned data authorization identifier may, but is not limited to, an option or checkbox on the drawing application interface, and the user's choice will directly affect the generation of subsequent training data.

[0086] Optionally, the above-mentioned construction of training samples may, but is not limited to, involve the process of converting the target drawing and drawing parameters into a format suitable for training the machine learning model, i.e., preparing input-output data pairs.

[0087] Furthermore, the aforementioned "ignore target drawing and drawing parameters" may, but is not limited to, prevent the drawing and parameters from being used as training data when the user has not granted data authorization.

[0088] For example, such as Figure 7 As shown, before requesting the generation of drawings, users can select whether to generate training data in the parameter settings area of ​​the drawing generation pop-up window displayed in the drawing generation interface. If the user selects this option, training data can be constructed using the current drawing parameters and the generated drawing.

[0089] In this embodiment, a data authorization identifier carried in the drafting request is obtained. This identifier indicates whether training samples can be constructed based on the target drawing and its parameters. The data authorization identifier is selected by the drawing application account within the drawing generation interface of the target drawing application. If the data authorization identifier indicates that training samples cannot be constructed based on the target drawing and its parameters, the target drawing and its parameters are ignored. By including a data authorization identifier in the drafting request, users can decide whether to use their drafting content for model training, giving them control over their data usage. This establishes user trust and provides a transparent data source for model training. When users do not allow data use, related drawings and parameters can be automatically ignored, maintaining a healthy data usage ecosystem.

[0090] As an optional approach, determining the training input data based on the target drawing and the training output data based on the drawing parameters includes:

[0091] When the data authorization identifier indicates that training samples can be constructed based on the target drawing and drawing parameters, the training input data is determined based on the target drawing, and the training output data is determined based on the drawing parameters.

[0092] In this embodiment, when the data authorization identifier indicates permission to construct training samples based on the target drawing and its parameters, the training input data is determined based on the target drawing, and the training output data is determined based on the drawing parameters. By including a data authorization identifier in the drawing request, users can decide whether to use their drawing content for model training, giving them control over their data usage. This establishes user trust and provides a transparent data source for model training. When users do not allow data use, related drawings and parameters can be automatically ignored, maintaining a healthy data usage ecosystem.

[0093] As an optional approach, after adding the training samples, consisting of training input data and training output data, to the training database, the following steps are included:

[0094] Once the number of training samples in the training database reaches the predetermined number, perform the following steps:

[0095] The i-th training input data from the i-th training sample is input into the i-th drawing recognition model to obtain the i-th model output data, where i is a positive integer. The i-th drawing recognition model is the drawing recognition model obtained after i-1 training adjustments to the initial drawing recognition model. The training database includes the i-th training sample.

[0096] Based on the output data of the i-th model and the training output data in the i-th training sample, generate the i-th training loss;

[0097] If the i-th drawing recognition model reaches the convergence condition based on the i-th training loss, the i-th drawing recognition model is determined as the target model.

[0098] If the i-th drawing recognition model has not reached the convergence condition based on the i-th training loss, the model parameters of the i-th drawing recognition model are adjusted based on the i-th training loss to obtain the (i+1)-th drawing recognition model.

[0099] Optionally, reaching a predetermined number of training samples means accumulating a sufficient number of training samples in the database, reaching a pre-set threshold or quantity standard. This step ensures that the model training has a sufficient data foundation to improve the model's generalization ability and recognition accuracy.

[0100] Furthermore, the i-th training input data in the i-th training sample refers to the image data provided by the i-th sample in the training database, which can be the pixel matrix generated above. Each round of model training uses the input data of one training sample.

[0101] It should be noted that the i-th drawing recognition model mentioned above can, but is not limited to, represent a model version that is gradually optimized as the training process progresses. The initial model is adjusted through multiple rounds of training, and each "i-th" model version is obtained by optimizing the parameters based on the results of the previous training.

[0102] Optionally, inputting the i-th training input data into the i-th drawing recognition model means feeding the input data of the current training sample into the corresponding model version to evaluate the current state and predictive ability of the model.

[0103] It should be further clarified that the output data of the i-th model mentioned above can be, but is not limited to, the model's prediction results given the training input data. It reflects the model's level of understanding and interpretation of the input data based on the current parameter settings.

[0104] Furthermore, the generation of the i-th training loss described above can, but is not limited to, quantifying the difference between the model's output data and the actual output data (i.e., the true values ​​of the drawing parameters) in the training samples. Training loss (or error function) is a metric for measuring the accuracy of model predictions and is often used to guide the adjustment of model parameters.

[0105] Optionally, the convergence condition mentioned above refers to the standard by which the model training reaches a predetermined goal, typically when the training loss decreases to a preset threshold range, or when the model performance no longer improves significantly. Reaching the convergence condition indicates that the model has learned to recognize the basic patterns of drawing parameters on the current training set.

[0106] It should be noted that the target model mentioned above may be, but is not limited to, the final product of the training process, i.e., a model version that has reached or exceeded the preset performance standard after multiple rounds of iteration and parameter adjustment. It is a model used for actual drawing recognition tasks.

[0107] Furthermore, the above-mentioned adjustment of the model parameters of the i-th drawing recognition model based on the i-th training loss refers to updating the internal parameters of the model through a backpropagation algorithm (such as gradient descent) according to the model's performance on the current training samples, in order to improve the model's performance in the next round of training.

[0108] Optionally, the (i+1)th drawing recognition model mentioned above refers to the next model version after parameter adjustments. Each parameter update aims to improve the model's ability to recognize subsequent training samples, gradually approaching the optimal model state.

[0109] As an optional example, the above steps can be illustrated using, but not limited to, the following examples:

[0110] Training sample accumulation:

[0111] Before training begins, a sufficient number of training samples need to be accumulated. These samples consist of training input data (such as the image representation of the drawing) and training output data (such as the encoded information of the drawing parameters), and are stored in the training database. The predetermined number is set based on the complexity of the model, the diversity of the training data, and the expected generalization ability of the model.

[0112] Iterative training process (taking the i-th round of training as an example):

[0113] Input data processing: The training input data (i.e., the drawing image) from the i-th training sample is input into the i-th drawing recognition model. This step may involve data preprocessing, such as image size standardization and pixel value normalization, to ensure that the model can effectively process the input.

[0114] Model prediction: Based on the input drawing image, the model predicts the encoding information of the drawing parameters and generates the i-th model output data.

[0115] Loss calculation: Based on the output data of the i-th model and the known training output data in the i-th training sample, the i-th training loss is calculated. This is usually quantified by comparing the difference between the model prediction and the true parameters using some loss function (such as mean squared error, cross-entropy loss, etc.).

[0116] Convergence check: Analyze whether the training loss of the i-th training stage meets the convergence condition, which usually means that the loss value stabilizes within a small range and no longer decreases significantly. If it is met, it means that the model has learned enough information and training can stop; if it is not met, the model needs to be further optimized.

[0117] Model parameter adjustment:

[0118] If the i-th training loss indicates that the model has not yet converged, meaning there is still room for improvement in model performance, then the parameters of the i-th drawing recognition model need to be adjusted based on the i-th training loss. This is typically achieved through the backpropagation algorithm, which updates the model's weights and biases based on the gradient of the loss function, hoping to reduce the loss in the next round of training.

[0119] The updated model parameters will generate the (i+1)th drawing recognition model. This model is based on the ith model, with parameters optimized according to the training loss, and should theoretically be more accurate than the previous version.

[0120] Iterate until convergence:

[0121] The entire training process is an iterative loop. It starts from the first round of training and continues until the model reaches the convergence condition on the training dataset, that is, the loss value no longer decreases significantly, or the pre-set number of training rounds is reached.

[0122] Model determined:

[0123] Once the model reaches the convergence condition, that is, when the i-th drawing recognition model is determined to have reached the convergence condition based on the i-th training loss, the i-th drawing recognition model is determined as the target model, which means that it can now effectively identify parameters on new, unseen drawing data.

[0124] Optionally, after obtaining the target model mentioned above, the following may also be included, but are not limited to:

[0125] S1, Obtain the recognition request for recognizing the first drawing;

[0126] S2, convert the first drawing carried in the above recognition request into a first grayscale image;

[0127] S3, the first grayscale image is divided into multiple pixel blocks, and a first matrix is ​​created based on the multiple pixel blocks, wherein each element in the first matrix is ​​used to characterize the pixel block information of the corresponding pixel block in the first grayscale image;

[0128] S3, input the first matrix into the target model to obtain the encoding information of the drawing parameters of the first drawing;

[0129] S4, decode the encoded information to obtain the drawing parameters of the first drawing;

[0130] S5 returns the drawing parameters to the terminal device used to send the aforementioned identification request.

[0131] In this embodiment, when the number of training samples in the training database reaches a predetermined number, the following steps are performed: The i-th training input data from the i-th training sample is input into the i-th drawing recognition model to obtain the i-th model output data, where i is a positive integer, the i-th drawing recognition model is the drawing recognition model obtained after i-1 training adjustments to the initial drawing recognition model, and the training database includes the i-th training sample; based on the i-th model output data and the training output data in the i-th training sample, the i-th training loss is generated; if the i-th drawing recognition model is determined to have reached the convergence condition based on the i-th training loss, the i-th drawing recognition model is determined as the target model; if the i-th drawing recognition model is determined not to have reached the convergence condition based on the i-th training loss, the model parameters of the i-th drawing recognition model are adjusted based on the i-th training loss to obtain the (i+1)-th drawing recognition model. By setting a predetermined number of training sample thresholds, this embodiment ensures that the model starts training with a sufficient amount of data, avoiding underfitting due to insufficient samples. As the number of training iterations increases, the model continuously adjusts its parameters, gradually approaching the optimal solution. This process not only improves the model's prediction accuracy but also enhances its stability.

[0132] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0133] According to another aspect of the embodiments of this application, a training data acquisition device for a drawing recognition model is also provided for implementing the above-described method for acquiring training data for the drawing recognition model. For example... Figure 8 As shown, the device includes:

[0134] The receiving unit 802 is used to receive a drawing request initiated by a drawing application account through a target drawing application, wherein the drawing request carries drawing parameters for drawing the drawing.

[0135] The generation unit 804 is used to generate a target drawing based on drawing parameters in response to a drawing request;

[0136] The determination unit 806 is used to determine the training input data based on the target drawing and to determine the training output data based on the drawing parameters.

[0137] The addition unit 808 is used to add training samples consisting of training input data and training output data to the training database. The training samples in the training database will be used to train the drawing recognition model, which is used to identify the drawing parameters corresponding to the drawing from the drawing.

[0138] Optionally, in this embodiment, the determining unit includes: a conversion module for converting the target drawing into a grayscale image that matches the target drawing; a creation module for segmenting the grayscale image into multiple pixel blocks and creating a target matrix based on the multiple pixel blocks, wherein each element in the target matrix is ​​used to characterize the pixel block information of the corresponding pixel block in the grayscale image; and a first determining module for determining the target matrix as training input data.

[0139] Optionally, in this embodiment, the determining unit includes: an encoding processing module, used to encode each parameter in the drawing parameters according to an encoding format that matches the drawing recognition model, to obtain encoding information that matches each parameter; and a first determining module, used to determine the encoding information that matches each parameter as training output data.

[0140] Optionally, in this embodiment, the above-mentioned device further includes: an acquisition unit, configured to acquire a data authorization identifier carried in the drawing request, wherein the data authorization identifier is used to indicate whether it is allowed to construct training samples based on the target drawing and drawing parameters, and the data authorization identifier is selected by the drawing application account in the drawing generation interface of the target drawing application; and a first determination unit, configured to ignore the target drawing and drawing parameters when the data authorization identifier indicates that it is not allowed to construct training samples based on the target drawing and drawing parameters.

[0141] Optionally, in this embodiment, the determining unit further includes a third determining module, used to determine training input data based on the target drawing and training output data based on the drawing parameters when the data authorization identifier indicates that training samples can be constructed based on the target drawing and drawing parameters.

[0142] Optionally, in this embodiment, the above-mentioned device further includes: a training unit, configured to perform the following steps when the number of training samples in the training database reaches a predetermined number: inputting the i-th training input data from the i-th training sample into the i-th drawing recognition model to obtain the i-th model output data, where i is a positive integer, the i-th drawing recognition model is a drawing recognition model obtained after i-1 training adjustments to the initial drawing recognition model, and the training database includes the i-th training sample; generating the i-th training loss based on the i-th model output data and the training output data in the i-th training sample; determining the i-th drawing recognition model as the target model if the i-th drawing recognition model has reached the convergence condition based on the i-th training loss; and adjusting the model parameters of the i-th drawing recognition model based on the i-th training loss if the i-th training loss has not reached the convergence condition to obtain the (i+1)-th drawing recognition model.

[0143] For specific implementation examples, please refer to the example shown in the above-described method for obtaining training data for drawing recognition models. This embodiment will not be repeated here.

[0144] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described method for acquiring training data for drawing recognition models is also provided. This electronic device may be... Figure 1 The terminal device or server shown. This embodiment uses the electronic device as a server as an example for illustration. Figure 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps of any of the above method embodiments through the computer program.

[0145] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.

[0146] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0147] S1, Receive a drawing request initiated by the drawing application account through the target drawing application, wherein the drawing request carries drawing parameters for drawing the drawing;

[0148] S2, in response to a drafting request, generates the target drawing based on the drawing parameters;

[0149] S3 determines the training input data based on the target drawing and the training output data based on the drawing parameters;

[0150] S4. Training samples consisting of training input data and training output data are added to the training database. The training samples in the training database will be used to train the drawing recognition model, which is used to identify the drawing parameters corresponding to the drawing from the drawing.

[0151] Alternatively, as those skilled in the art will understand, Figure 9 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 9 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 9 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 9 The different configurations shown.

[0152] The memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the drawing recognition model training data acquisition method and apparatus in this embodiment. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, thereby realizing the above-mentioned drawing recognition model training data acquisition method. The memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include memory remotely located relative to the processor 904, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. As an example, such as Figure 9 As shown, the memory 902 may include, but is not limited to, the receiving unit 802, generating unit 804, determining unit 806, and adding unit 808 from the training data acquisition device for the drawing recognition model. Furthermore, it may include, but is not limited to, other module units from the training data acquisition device for the drawing recognition model, which will not be elaborated upon in this example.

[0153] Optionally, the transmission device 906 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 906 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 906 is a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0154] In addition, the aforementioned electronic device also includes a display 908 and a connection bus 910 for connecting the various module components in the aforementioned electronic device.

[0155] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a point-to-point network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this point-to-point network.

[0156] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions provided in the embodiments of this application.

[0157] According to one aspect of this application, another computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the methods in various embodiments of this application.

[0158] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described method.

[0159] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0160] S1, Receive a drawing request initiated by the drawing application account through the target drawing application, wherein the drawing request carries drawing parameters for drawing the drawing;

[0161] S2, in response to a drafting request, generates the target drawing based on the drawing parameters;

[0162] S3 determines the training input data based on the target drawing and the training output data based on the drawing parameters;

[0163] S4. Training samples consisting of training input data and training output data are added to the training database. The training samples in the training database will be used to train the drawing recognition model, which is used to identify the drawing parameters corresponding to the drawing from the drawing.

[0164] It should be noted that the data collection and processing described in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0165] Optionally, in the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0166] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0167] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0168] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0169] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0170] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0171] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0172] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for acquiring training data for a drawing recognition model, characterized in that, include: Receive a drawing request initiated by a drawing application account through a target drawing application, wherein the drawing request carries drawing parameters for drawing the drawing; In response to the drawing request, a target drawing is generated based on the drawing parameters; The target drawing is converted into a grayscale image that matches the target drawing; the grayscale image is divided into multiple pixel blocks, and a target matrix is ​​created based on the multiple pixel blocks, wherein each element in the target matrix is ​​used to characterize the pixel block information of the corresponding pixel block in the grayscale image; the target matrix is ​​determined as training input data. According to the encoding format that matches the drawing recognition model, each parameter in the drawing parameters is encoded to obtain the encoding information that matches each parameter; the encoding information that matches each parameter is determined as the training output data. The training samples, consisting of the training input data and the training output data, are added to the training database. The training samples in the training database are used to train the drawing recognition model, which is used to identify the drawing parameters corresponding to the drawing from the drawing.

2. The method according to claim 1, characterized in that, After generating the target drawing based on the drawing parameters in response to the drawing request, the method further includes: Obtain the data authorization identifier carried in the drawing request, wherein the data authorization identifier is used to indicate whether it is allowed to construct the training sample based on the target drawing and the drawing parameters, and the data authorization identifier is selected based on the drawing application account in the drawing generation interface of the target drawing application; If the data authorization identifier indicates that the training sample is not allowed to be constructed based on the target drawing and the drawing parameters, the target drawing and the drawing parameters shall be ignored.

3. The method according to claim 2, characterized in that, The process of determining training input data based on the target drawing and determining training output data based on the drawing parameters includes: If the data authorization identifier indicates that the training sample can be constructed based on the target drawing and the drawing parameters, the training input data is determined based on the target drawing, and the training output data is determined based on the drawing parameters.

4. The method according to any one of claims 1 to 3, characterized in that, After adding the training samples, consisting of the training input data and the training output data, to the training database, the process includes: If the number of training samples in the training database reaches a predetermined number, the following steps are performed: The i-th training input data from the i-th training sample is input into the i-th drawing recognition model to obtain the i-th model output data, where i is a positive integer. The i-th drawing recognition model is the drawing recognition model obtained after i-1 training adjustments to the initial drawing recognition model. The training database includes the i-th training sample. Based on the output data of the i-th model and the training output data in the i-th training sample, generate the i-th training loss; If the i-th drawing recognition model is determined to have reached the convergence condition based on the i-th training loss, the i-th drawing recognition model is determined as the target model; If, based on the i-th training loss, it is determined that the i-th drawing recognition model has not reached the convergence condition, the model parameters of the i-th drawing recognition model are adjusted based on the i-th training loss to obtain the (i+1)-th drawing recognition model.

5. A device for acquiring training data for a drawing recognition model, characterized in that, include: The receiving unit is used to receive a drawing request initiated by a drawing application account through a target drawing application, wherein the drawing request carries drawing parameters for drawing the drawing. A generation unit is configured to generate a target drawing based on the drawing parameters in response to the drawing request; A determining unit is configured to: convert the target drawing into a grayscale image matching the target drawing; segment the grayscale image into multiple pixel blocks and create a target matrix based on the multiple pixel blocks, wherein each element in the target matrix is ​​used to characterize the pixel block information of the corresponding pixel block in the grayscale image; determine the target matrix as training input data; encode each parameter in the drawing parameters according to an encoding format matching the drawing recognition model to obtain encoding information matching each parameter; and determine the encoding information matching each parameter as training output data. The adding unit is used to add training samples consisting of the training input data and the training output data to the training database, wherein the training samples in the training database will be used to train the drawing recognition model, and the drawing recognition model is used to identify the drawing parameters corresponding to the drawing from the drawing.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program is executed by a processor to perform the method described in any one of claims 1 to 4.

7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1 to 4.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 4 through the computer program.

Citation Information

Patent Citations

  • Incremental training method and device for drawing recognition model, equipment and medium

    CN117292393A

  • Construction method and device of industrial drawing training data set, electronic equipment and storage medium

    CN121259485A