Electrical element symbol identification method based on segmentation technology and related device
By adopting the electrical component symbol recognition method based on segmentation technology in the CAD drawings of the secondary system of the substation, and using training, fine adjustment and quantization processing technologies, the problem of insufficient accuracy of the existing recognition methods is solved, and more accurate and efficient symbol recognition of electrical component is achieved.
Patent Information
- Application Number
- CN202411666322.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-04-15
AI Technical Summary
The identification method of electrical component symbols in the CAD drawings of the existing substation secondary system is not accurate enough to achieve more accurate and efficient identification of electrical component symbols.
The symbol recognition method of electrical components based on segmentation technology is adopted. By using the acquired electrical drawings and labeled images as training data, the initial recognition model is constructed, and the accuracy of the recognition model is gradually improved through training, fine adjustment and quantization processing.
Through this method, the accuracy and efficiency of the identification of electrical component symbols can be significantly improved, and more accurate and efficient identification of electrical component symbols can be achieved.
Smart Images

Figure CN119832584A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to an electrical component symbol recognition method based on segmentation technology and a related device. Background Art
[0002] The main body of electrical symbol recognition in the computer-aided design (CAD) drawings of the secondary system of the substation is usually an electrical drawing in the form of an electrical facility schematic diagram, and the recognition objects are mainly electrical components in the drawings, such as main transformers, current transformers, voltage transformers and electric energy meters. There are two main methods for identifying electrical components in the existing CAD drawings of the secondary system of the substation: one is to segment and match electrical components by primitive segmentation, which may confuse electrical symbols with similar primitives; the other is to identify the type of electrical symbols by calculating the local features of electrical symbols, such as by using scale-invariant feature transform (SIFT), local binary pattern (LBP), histogram of oriented gradients (HOG) and other calculation methods. However, the existing two recognition results for electrical component symbols are not accurate enough, and cannot achieve the purpose of more accurate and efficient electrical component symbol recognition. Summary of the invention
[0003] The present invention provides an electrical component symbol recognition method and related device based on segmentation technology to solve the technical problem that the recognition result of electrical component symbols is not accurate enough.
[0004] In a first aspect, a method for identifying electrical component symbols based on segmentation technology is provided, comprising:
[0005] The obtained electrical drawing set and electrical component annotated image set are used as a training data set;
[0006] Based on the image encoder, the hint encoder and the mask decoder, an initial electrical component symbol recognition model is constructed and obtained;
[0007] Based on the training data set, the initial electrical component symbol recognition model is trained to obtain a reference electrical component symbol recognition model;
[0008] Based on the training data set, the reference electrical component symbol recognition model is fine-tuned to obtain a fine-tuned electrical component symbol recognition model;
[0009] The fine-tuned electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
[0010] In a second aspect, a device for identifying electrical component symbols based on segmentation technology is provided, comprising:
[0011] An acquisition module, used to use the acquired electrical drawing set and electrical component annotated image set as a training data set;
[0012] A first processing module is used for constructing and obtaining an initial electrical component symbol recognition model based on an image encoder, a hint encoder and a mask decoder;
[0013] A second processing module is used to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model;
[0014] A third processing module is used to fine-tune the reference electrical component symbol recognition model based on the training data set to obtain a fine-tuned electrical component symbol recognition model;
[0015] The fourth processing module is used to perform quantization processing on the fine-tuned electrical component symbol recognition model to obtain a target electrical component symbol recognition model.
[0016] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned electrical component symbol recognition method based on segmentation technology when executing the computer program.
[0017] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the electrical component symbol recognition method based on the segmentation technology are implemented.
[0018] In the scheme implemented by the electrical component symbol recognition method and related devices based on the segmentation technology, the acquired electrical drawing set and electrical component annotation image set are used as the training data set, and based on the image encoder, prompt encoder and mask decoder, an initial electrical component symbol recognition model is constructed and obtained, and the initial electrical component symbol recognition model is trained based on the training data set to obtain a reference electrical component symbol recognition model, so that the reference electrical component symbol recognition model can be fine-tuned based on the training data set to obtain a fine-tuned electrical component symbol recognition model, and then the fine-tuned electrical component symbol recognition model can be quantized to obtain a more accurate target electrical component symbol recognition model, which is beneficial to improving the recognition results for electrical component symbols and achieving the purpose of more accurate and efficient electrical component symbol recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1 is a schematic diagram of an application environment of an electrical component symbol recognition method based on segmentation technology in one embodiment of the present invention;
[0021] Figure 2 is a flow chart of an electrical component symbol recognition method based on segmentation technology in one embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of different representations of the same electrical symbol in one embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of the calculation of the segmentation operator of the same electrical symbol in one embodiment of the present invention;
[0024] Figure 5 is a schematic diagram of model acceleration-operator fusion in one embodiment of the present invention;
[0025] Figure 6 It is a key framework schematic diagram of an electrical component symbol recognition method based on segmentation technology in one embodiment of the present invention;
[0026] Figure 7 is a structural schematic diagram of an electrical component symbol recognition device based on segmentation technology in one embodiment of the present invention;
[0027] Figure 8 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0028] Fig. 9 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] The electrical component symbol recognition method based on segmentation technology provided by the embodiment of the present invention can be applied in the following aspects: Figure 1In an application environment, the client communicates with the server through a network. Exemplarily, taking the electrical component symbol recognition scenario as an example, the target user (R&D personnel or management personnel) can upload an electrical drawing set and an electrical component annotated image set through the client. Correspondingly, the server can obtain the electrical drawing set and the electrical component annotated image set through the client, and use the obtained electrical drawing set and the electrical component annotated image set as a training data set, and build and obtain an initial electrical component symbol recognition model based on an image encoder, a prompt encoder and a mask decoder, so as to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model, so as to fine-tune the reference electrical component symbol recognition model based on the training data set to obtain a fine-tuned electrical component symbol recognition model, and then quantize the fine-tuned electrical component symbol recognition model to obtain a more accurate target electrical component symbol recognition model, so as to obtain a more accurate electrical component symbol recognition result based on the target electrical component symbol recognition model, and feed the electrical component symbol recognition result back to the client. Accordingly, the client can receive the electrical component symbol recognition result from the server, and can display the electrical component symbol recognition result on the client for the target user to query or browse. By adopting the electrical component symbol recognition method based on segmentation technology provided by the present application, it is beneficial to improve the recognition result for electrical component symbols and achieve the purpose of more accurate and efficient electrical component symbol recognition.
[0031] The client may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented by an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.
[0032] See also Figure 2 As shown, Figure 2 A flow chart of an electrical component symbol recognition method based on segmentation technology provided by an embodiment of the present invention includes the following steps:
[0033] S10: The acquired electrical drawing set and electrical component annotated image set are used as a training data set.
[0034] The electrical drawing set may include one or more electrical drawings, and the electrical drawings may be drawings related to the electrical system. It is understandable that the electrical drawings may be unlabeled drawing data, and this application does not limit this. Optionally, the drawings involved in this application may all be CAD drawing data, which does not limit this application.
[0035] The electrical component annotated image set may include one or more electrical component annotated images, which may generally include electrical component images in a CAD drawing of a substation secondary system, and each electrical component has an accurate annotation (e.g., position, type, etc.). The electrical component annotated image may be obtained by manual annotation or with the aid of some semi-automatic annotation tools, and the present application does not limit this.
[0036] The electrical drawings collection and the electrical component annotated image collection are essential for training and evaluating the model. Optionally, the unannotated drawings in the electrical drawings collection can be rotated, flipped, scaled, translated, and other geometric transformations to generate more training samples, which helps increase the model's ability to recognize electrical components in different positions, angles, and sizes, thereby improving the robustness of the model.
[0037] Since the color and clarity of electrical components in actual CAD drawings may be affected by factors such as drawing software and print quality, color jittering and noise addition can be performed to simulate real usage scenarios. Through the above processing, a more comprehensive and richer training data set can be obtained, which is helpful for training a more accurate initial electrical component symbol recognition model.
[0038] S20: Based on the image encoder, the prompt encoder and the mask decoder, an initial electrical component symbol recognition model is constructed and obtained.
[0039] The present application can build a model based on the three core modules of image encoder, prompt encoder and mask decoder. Among them, the image encoder can be responsible for converting the input electrical component image into a feature representation. The prompt encoder can process various prompt information (such as points, boxes, text, etc.) and convert it into an embedding that matches the image features. The mask decoder can integrate the image features and prompt embedding to generate the final electrical component segmentation mask, thereby obtaining the electrical component recognition result.
[0040] It should be understood that, based on the training data set, training the initial electrical component symbol recognition model to obtain a reference electrical component symbol recognition model refers to the process of training the initial electrical component symbol recognition model to obtain a reference electrical component symbol recognition model. Among them, step S20, that is, based on the training data set, training the initial electrical component symbol recognition model to obtain a reference electrical component symbol recognition model, includes the following steps:
[0041] S21: performing image processing on each training data in the training data set by using the image encoder in the initial electrical component symbol recognition model to obtain an electrical component feature image set;
[0042] S22: performing embedding processing on each electrical component feature image in the electrical component feature image set through the prompt encoder in the initial electrical component symbol recognition model to obtain an embedded electrical component feature image set;
[0043] S23: decoding each embedded electrical component feature image in the embedded electrical component feature image set by means of a mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result;
[0044] S24: According to the electrical component recognition result, the initial electrical component symbol recognition model is trained to obtain a reference electrical component symbol recognition model.
[0045] The image encoder plays a key role in the first step of the entire model training process. The image encoder can process the original electrical component image data (i.e., each training data) in the training data set to extract an image representation that can effectively characterize the characteristics of the electrical component, thereby obtaining a set of electrical component feature images.
[0046] Image encoders can usually be based on architectures such as vision transformers to divide the input electrical component image into a series of image patches and perform operations such as linear embedding on the image patches. This allows the encoder to capture long-range dependencies in the image and key features of electrical components through its internal self-attention mechanism, thereby converting the original image into a more expressive set of electrical component feature images.
[0047] The prompt encoder can further process the set of electrical component feature images obtained by the image encoder to combine each electrical component feature image with possible prompt information (such as points, boxes, text, etc. for auxiliary identification), so as to further convert it into an embedded representation that is more suitable for subsequent decoding processing, thereby obtaining a set of embedded electrical component feature images.
[0048] The hint encoder can be implemented by a designed embedding module, such as a multilayer perceptron (MLP), to perform linear transformation and nonlinear activation operations on the electrical component feature images, and at the same time combine the input hint information to uniformly convert it into a low-dimensional embedding vector, so that these embedded electrical component feature images can be better utilized by the mask decoder.
[0049] The mask decoder can restore and obtain the final electrical component recognition result from the set of embedded electrical component feature images. The mask decoder can comprehensively consider the features extracted by the image encoder and the hint information incorporated by the hint encoder to accurately identify the key information such as the position and shape of each electrical component in the image, thereby determining the specific electrical component type.
[0050] The mask decoder can usually be based on architectures such as a convolutional neural network (CNN) or a deconvolution network to upsample and convolve the embedded electrical component feature image, thereby gradually recovering recognition results such as a segmentation mask that is close to the size of the input image, and by continuously adjusting parameters such as the convolution kernel size and step size, it can accurately decode the relevant information of the electrical component from the feature map, thereby obtaining the electrical component recognition result.
[0051] It should be understood that the process of decoding each embedded electrical component feature image in the embedded electrical component feature image set by the mask decoder in the initial electrical component symbol recognition model to obtain the electrical component recognition result refers to how to obtain the electrical component recognition result. Among them, step S23, that is, decoding each embedded electrical component feature image in the embedded electrical component feature image set by the mask decoder in the initial electrical component symbol recognition model to obtain the electrical component recognition result, includes the following steps:
[0052] S231: initializing each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an initialized electrical component feature image set;
[0053] S232: performing up-sampling processing on each of the initialized electrical component feature images in the initialized electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain a high-dimensional electrical component feature image set;
[0054] S233: performing convolution processing on each high-dimensional electrical component feature image in the high-dimensional electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain a multi-scale electrical component feature image set;
[0055] S234: performing feature fusion processing on each multi-scale electrical component feature image in the multi-scale electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain a fused electrical component feature image set;
[0056] S235: Using the mask decoder in the initial electrical component symbol recognition model, segment each fused electrical component feature image in the fused electrical component feature image set based on the segmentation technology to obtain an electrical component recognition result.
[0057] For each image embedded in the electrical component feature image set, its data format and dimension information can be checked first to ensure that it meets the requirements of subsequent model processing. For example, if the model expects the input image data to be in a specific tensor format, the corresponding conversion can be performed. At the same time, auxiliary parameters related to the image can be initialized, such as flags that may be used to mark the progress of image processing, and temporary variables that may be used in subsequent upsampling and convolution processes, etc. This application does not limit this.
[0058] The upsampling process can increase the size of the feature image, so that it can be gradually restored from the low-dimensional embedded representation to a size closer to the original electrical component image, thereby containing more spatial information and preparing for subsequent accurate segmentation and recognition. The server can use a variety of upsampling algorithms, such as bilinear interpolation, nearest neighbor interpolation, or transposed convolution. The application is described below using the transposed convolution as an example, which does not constitute a limitation on the application.
[0059] The server can determine the size, step size and padding of the transposed convolution kernel according to the desired upsampling multiple and the characteristics of the electrical component image, thereby setting the transposed convolution parameters. For example, if you want to double the feature image in both height and width, you can set a suitable convolution kernel size (such as 3×3 or 4×4), a step size of 2, and select an appropriate padding method to maintain the continuity of the image boundary.
[0060] For each initialized electrical component feature image, the server can use the set transposed convolution parameters to operate. During the transposed convolution process, the convolution kernel slides on the image, and the eigenvalues in the image are weighted and summed according to the weight of the convolution kernel to generate a new, larger feature map, thereby obtaining a high-dimensional electrical component feature image set. It can be understood that in the local area of each image, new pixel values can be generated based on the surrounding eigenvalues to enrich the spatial information of the image.
[0061] The convolution operation is used to extract and enhance the electrical component related features in the high-dimensional feature image, so that different convolution kernels can capture features of different scales and directions, in preparation for the subsequent multi-scale feature fusion.
[0062] There may be one or more convolutional layers. Each convolutional layer contains multiple convolution kernels, and the size, number, and number of channels of the convolution kernels are determined according to the characteristic complexity of the electrical components. For example, for electrical components with complex textures and shapes, multiple convolution kernels of different sizes (such as 3×3, 5×5) and a larger number of convolution kernels (such as 64 or 128) may be used.
[0063] For each image in the high-dimensional electrical component feature image set, it can be input into the convolution layer in turn; each convolution kernel slides on the image, performs a dot product operation with the local area in the image, and uses the result as a new feature value. At the same time, activation functions (such as ReLU) can be used in the convolution layer to introduce nonlinear characteristics, thereby enhancing the model's ability to express complex features. After multiple convolution operations, different convolution layers can capture features at different levels, from low-level edges and textures to high-level overall shapes of electrical components, thereby obtaining a multi-scale electrical component feature image set.
[0064] Integrating the electrical component features extracted at different scales can make full use of the information at each scale, so that the model can take into account both local details and overall structure, thereby improving the accuracy of recognition. Optionally, the server can adopt a variety of feature fusion strategies, such as splicing, addition or weighted fusion of feature maps, etc., which is not limited in this application. For example, for images in a multi-scale electrical component feature image set, the feature maps output by different convolutional layers can be spliced in the channel dimension. Assume that an image is processed by three convolutional layers of different scales to obtain three feature maps, each with a different number of channels. They are spliced together in the channel dimension to form a new fused feature map.
[0065] Optionally, if weighted fusion or other methods are used, the weight of each scale feature map needs to be determined. The weight can be a fixed value or learned during model training. Through reasonable weight distribution, some more important scale features can be highlighted to obtain a set of fused electrical component feature images.
[0066] Based on the previously fused feature image, segmentation technology is used to accurately divide the position of each electrical component in the image to further determine its boundary and shape. Optionally, the electrical components can also be classified to obtain a complete electrical component recognition result.
[0067] For each image in the set of fused electrical component feature images, a threshold segmentation method can be used. Set a suitable threshold (this threshold can be determined experimentally during the training process) to compare the pixel value in the image with the threshold. If the pixel value is greater than the threshold, the pixel can be marked as belonging to a certain electrical component; if it is less than the threshold, it can be marked as the background, so as to preliminarily obtain a binary segmentation mask.
[0068] Optionally, the server can also use machine learning-based segmentation algorithms, such as support vector machines (SVM), random forests, etc., to take the fused feature image as input and train these models to predict the probability of each pixel belonging to an electrical component or background. Alternatively, a deep learning-based segmentation method can be used, such as further applying a fully convolutional network (FCN) architecture on the fused feature image for more refined segmentation.
[0069] Optionally, the server can extract features from each segmented electrical component region based on segmentation, and then use a classifier (such as a multi-layer perceptron, a convolutional neural network, etc.) to perform type recognition. The classifier can map the extracted features to different electrical component categories based on pre-trained model parameters, thereby obtaining a complete electrical component recognition result, which can include the location and type information of each electrical component.
[0070] After obtaining the electrical component recognition result, the performance of the initial electrical component symbol recognition model can be evaluated based on the electrical component recognition result. Common evaluation indicators may include but are not limited to accuracy, recall, F1 value, etc. Among them, accuracy may refer to the percentage of the number of electrical components correctly recognized by the model to the predicted number of electrical components; recall may refer to the percentage of the number of electrical components correctly recognized by the model to the actual number of electrical components; F1 value may be a balanced indicator that comprehensively considers accuracy and recall.
[0071] According to the difference between the above evaluation indicators and the actual electrical component recognition results (usually measured by loss functions, such as cross entropy loss, etc.), the parameters of the initial electrical component symbol recognition model can be further adjusted. During the training process, the model will continue to try different parameter values so that the difference between the predicted results and the actual results is gradually reduced. After multiple iterations of training, a reference electrical component symbol recognition model with better performance is finally obtained.
[0072] S30: Based on the training data set, the initial electrical component symbol recognition model is trained to obtain a reference electrical component symbol recognition model.
[0073] During the training process, the model will adjust the model parameters based on the difference between the predicted results and the actual annotations (usually measured using a loss function, such as cross entropy loss, etc.). After multiple iterative training, the model gradually learns how to accurately identify electrical component symbols, and finally obtains a reference electrical component symbol recognition model.
[0074] It can be understood that the reference electrical component symbol recognition model can basically identify standard electrical components in conventional substation power equipment drawings, including but not limited to main transformers, current transformers, voltage transformers, electric energy meters, disconnectors, circuit breakers, relays, control switches, main transformer high-voltage side terminal blocks, main transformer low-voltage side terminal blocks, fuses, etc., and this application does not impose any restrictions on this.
[0075] S40: Based on the training data set, fine-tune the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model.
[0076] In order to make the model better able to handle different representations of the same electrical symbol, the reference model is fine-tuned. This may involve using additional data containing electrical symbols in different representations for training, further optimizing the parameters of the model so that it can more accurately recognize diverse electrical symbols, thereby obtaining a fine-tuned electrical component symbol recognition model. Figure 3 As shown, Figure 3 Different representations of the same electrical symbol are shown as examples.
[0077] It should be understood that, based on the training data set, fine-tuning the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model refers to a process of fine-tuning the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model. Among them, step S40, that is, based on the training data set, fine-tuning the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model, includes the following steps:
[0078] S41: performing diversification processing on each training data in the training data set to obtain diversified data;
[0079] S42: labeling the diversified data to obtain fine-tuning training data;
[0080] S43: Determine a fine-tuning loss function term according to a fine-tuning processing target;
[0081] S44: Fine-tune the reference electrical component symbol recognition model according to the fine-tuning loss function term, the fine-tuning training data and the fine-tuning training parameters to obtain a fine-tuning electrical component symbol recognition model.
[0082] The server can perform diversified processing on each training data in the training data set to collect data containing different representations of the same type of electrical symbols. The data in different representations may be generated due to different design standards, drawing habits or software versions, such as different styles of current transformer symbols, voltage transformer symbols, etc. In order to ensure that the data can cover various situations that may occur in actual scenarios, the diversified data may include but is not limited to data corresponding to different scales, drawing clarity, background interference, etc., to improve the model's adaptability to complex situations.
[0083] Furthermore, the server can accurately annotate the collected data. The annotated content may include but is not limited to the specific type, location and shape (i.e., segmentation mask) of each electrical component. It is understandable that the server needs to pay attention to the accurate annotation of electrical components in different representation forms to ensure that the annotation information is consistent with the output target of the model.
[0084] Since the model has learned some common electrical component features in previous training, the existing parameters of the reference electrical component symbol recognition model can be used as initialization during the fine-tuning process, that is, most parameters can be kept unchanged, and only some parameters related to the new electrical symbol representation can be adjusted. For example, for the image encoder part, if it has learned the basic electrical component image feature extraction method, the learning rate of this part of the parameters can be appropriately reduced so that the model will not excessively change the existing good feature representation during the fine-tuning process; and for the parameters related to processing the new symbol representation in the prompt encoder and mask decoder, a relatively high learning rate can be set for adjustment.
[0085] A new loss function term can be designed according to the goal of the fine-tuning process to determine the fine-tuning loss function term. For example, if the focus is to improve the recognition accuracy of electrical symbols in different representations, a loss term based on the difference between different representations can be added; for example, for the same type of electrical components in two different representations (such as two styles of relay symbols), a loss term can be designed to measure the model's learning of the similarities and differences between the two representations in the feature space, so as to enable the model to better recognize them as the same type of electrical components.
[0086] The server can further determine the fine-tuning training parameters, such as the number of training epochs, batch size, and learning rate. The number of training epochs should not be too many to avoid overfitting, and can be adjusted according to the performance of the validation set; the batch size should be selected based on hardware resources and data characteristics. A suitable batch size helps stabilize the model training; the learning rate needs to be carefully selected to avoid too large a learning rate causing the model to fail to converge or too small a learning rate causing the training to be too slow.
[0087] In each round of training, the fine-tuning data can be input into the reference electrical component symbol recognition model in batches. The model can process the input data according to the normal forward propagation process, that is, through the image encoder, prompt encoder and mask decoder to obtain the recognition results of the electrical components. The server can calculate the loss value based on the output results and the annotated data, and use the optimization algorithm to update the model parameters to reduce the loss value. In this process, the model can gradually adjust its own parameters to better adapt to the new electrical symbol representation.
[0088] Optionally, during the fine-tuning training process, an independent validation set is periodically used to evaluate the performance of the model to analyze the recognition effect of the model on electrical components with different representations, such as whether the accuracy is improved, whether the recall rate of new symbol representations meets expectations, etc. The validation set can come from the same distribution as the fine-tuning training data, but does not participate in the training process.
[0089] If the model overfits on the validation set (e.g., the validation set loss starts to rise, while the training set loss continues to fall), some regularization measures can be taken, such as adding regularization terms, increasing the strength of data augmentation, etc. If the model performance does not meet expectations, you can try to adjust the training parameters (such as learning rate, batch size), or further increase the diversity and quantity of fine-tuning data. It is understandable that through continuous iteration and optimization of the above steps, a fine-tuned electrical component symbol recognition model is finally obtained, which has better performance when processing different representations of the same electrical symbol.
[0090] For example, Figure 4 As shown, Figure 4 The example of the segmentation operator calculation of the same electrical symbol is shown exemplarily. It can be understood that for different representations of the same electrical symbol, Figure 4 The fine-tuning model for the cued mask segmentation task shown can achieve a certain robustness of the model to different representations of electrical symbols of the same category, thereby achieving zero-sample generalization of the segmentation task.
[0091] S50: performing quantization processing on the fine-tuned electrical component symbol recognition model to obtain a target electrical component symbol recognition model.
[0092] In order to improve the inference speed of the model, the fine-tuned model is quantized. Quantization can reduce the calculation amount and storage space of the model, and accelerate the operation of the model without losing much accuracy. After quantization, the target electrical component symbol recognition model is obtained, which can meet the needs of practical applications in terms of accuracy and efficiency.
[0093] It should be understood that the quantization processing of the fine-tuning electrical component symbol recognition model to obtain the target electrical component symbol recognition model refers to the process of how to obtain the target electrical component symbol recognition model. Among them, step S50, that is, the quantization processing of the fine-tuning electrical component symbol recognition model to obtain the target electrical component symbol recognition model, includes the following steps:
[0094] S51: Analyze the structure of the fine-tuning electrical component symbol recognition model to obtain module importance evaluation data;
[0095] S52: Determine quantization accuracy data according to the module importance evaluation data and performance requirement data;
[0096] S53: Analyze the parameters of the fine-tuning electrical component symbol recognition model to obtain parameter analysis data;
[0097] S54: Analyze the data according to the parameters and determine the quantization range data;
[0098] S55: According to the quantization accuracy data and the quantization range data, the fine-tuning electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
[0099] The server can select appropriate quantization methods according to the characteristics of the model and application scenarios, such as model compression, pruning, distillation, neural architecture search (NAS), etc. Furthermore, the server can select corresponding quantization tools or libraries according to the selected quantization method.
[0100] By analyzing the structure of the fine-tuned electrical component symbol recognition model in detail, including the composition, connection mode, and parameter distribution of each module (image encoder, hint encoder, mask decoder), we can understand the importance of parameters in each module and the degree of influence on model performance. For example, some layers in the image encoder may play a key role in feature extraction, so they can be treated specially during quantization.
[0101] Furthermore, by statistically fine-tuning the number of parameters, data types (such as the precision of floating-point types), and parameter value ranges in the electrical component symbol recognition model, it is helpful to determine the quantized parameter range and precision settings. For example, if it is found that the value range of some parameters is small and the precision requirement is not extremely high, a lower precision quantization method can be considered.
[0102] The server can determine the quantization accuracy based on the hardware platform support and model performance requirements, such as quantizing the parameters in the model from 32-bit floating point to 8-bit integer (INT8). For different modules or layers, different quantization accuracy can be set according to their sensitivity to accuracy. For example, for the key layers in the mask decoder that have a greater impact on the segmentation results, a higher accuracy can be maintained or a more sophisticated quantization strategy can be adopted.
[0103] By analyzing the statistical information of the training data and model parameters, the server can further determine the quantization range of each quantization parameter. For example, the quantization interval can be determined by calculating the minimum and maximum values of the parameter, or a more complex quantization range determination method based on data distribution can be used to ensure that the quantization process does not cause excessive loss of information.
[0104] Furthermore, the parameters of the fine-tuning electrical component symbol recognition model can be quantized according to the set quantization accuracy and range. Optionally, in some quantization methods, the structure of the model may need to be adjusted. For example, when performing model trimming quantization, it may be necessary to modify the network structure of the model, remove the trimmed parts, and update the relevant connections and parameter indexes. For some quantization methods involving fusion operations (such as fusing convolution and quantization layers), the model structure may need to be updated accordingly according to the quantization strategy.
[0105] Optionally, the test set can be used to evaluate the performance of the quantized model. The main evaluation indicators may include but are not limited to accuracy, inference speed, etc. By comparing the changes in these indicators of the model before and after quantization, it can be ensured that the quantized model meets the requirements for improving inference speed while the accuracy loss is within an acceptable range.
[0106] If the performance of the quantized model drops significantly, the quantization parameters or quantization methods can be adjusted. For example, you can try to adjust the quantization accuracy, reselect the quantization range, or adopt a different quantization strategy, and then quantize and evaluate again until you get the target electrical component symbol recognition model that meets the performance requirements.
[0107] Through the above-mentioned quantization processing steps, the reasoning speed of the fine-tuning electrical component symbol recognition model can be improved while ensuring the model performance, so as to obtain a target electrical component symbol recognition model that is more suitable for practical applications.
[0108] For example, Figure 5 As shown, Figure 5 The schematic diagram of model acceleration-operator fusion is shown as an example. Figure 5The network optimization acceleration process based on the quantization / dequantization (Q / DQ) mode, that is, the network optimization acceleration strategy based on the Q / DQ mode, is demonstrated. Among them, the Q module (also known as the Q layer) and the DQ module (also known as the DQ layer) are mainly used to control the quantization and dequantization processes of the data. Quantization is the conversion of high-precision data (such as 32-bit floating point numbers) into low-precision data (such as 8-bit integers, i.e. INT8), and dequantization is the opposite process. The Conv (convolution) module can represent the convolution operation, which is a common operation for extracting features in deep learning. The Batch Normalization (BN) module can represent the batch normalization of data, which helps to accelerate the training process and improve the generalization ability of the model. The Add module represents the execution of the addition operation, which can be used to fuse data from different paths. The 32-bit floating point weight (Weights FP32) module can represent the weight data in the model, which is stored as 32-bit floating point numbers here.
[0109] When input data When quantized to INT8, the figure indicates that the output of the fused convolution is also INT8, that is, after quantizing the input data, the output data after the convolution operation also maintains INT8 precision. This quantization operation helps to reduce the storage space and computational complexity of the data, thereby accelerating the network's reasoning process. Figure 5 The tail Q layer in the network can be fused with the convolution, that is, by merging the quantization layer with the convolution layer to reduce the overhead of data transmission between layers, the inference performance can be further optimized and improved.
[0110] In order to obtain efficient inference performance, only the layers that are not exchanged with Q / DQ need to be quantized. That is, when selecting quantized layers, direct operations on Q / DQ layers can be avoided to ensure the correctness of network arithmetic. The purpose of the entire optimization process can be to convert the network to use INT8 calculations through Q / DQ mode without changing the correctness of network arithmetic, thereby reducing the amount of calculation and data accuracy and accelerating the inference performance of the network.
[0111] For example, Figure 6 As shown, Figure 6 The key framework diagram of the electrical component symbol recognition method based on segmentation technology is shown as an example. The method is a single model (end-to-end) that can perform interactive mask segmentation and automatic mask segmentation. The promptable console of the method allows builders to use it in a flexible way. Only the model needs to design the correct prompts (points, boxes, text, etc.) to complete a wide range of segmentation tasks or serve as the backbone of downstream semantic segmentation problems.
[0112] This method can return a valid segmentation mask for any hint, which can be foreground, background points, rough boxes or masks, free-form text, or any information that can indicate the content to be segmented in the image. It is mainly designed into three modules, namely the image encoder module, the hint encoder module and the mask decoder module. The specific implementation steps and effects can be found in the above details, and this application will not repeat them here.
[0113] It can be seen that in the above scheme, by taking the acquired electrical drawing set and electrical component annotated image set as the training data set, and based on the image encoder, the prompt encoder and the mask decoder, an initial electrical component symbol recognition model is constructed and obtained, so that the initial electrical component symbol recognition model is trained based on the training data set to obtain a reference electrical component symbol recognition model, so that the reference electrical component symbol recognition model can be fine-tuned based on the training data set to obtain a fine-tuned electrical component symbol recognition model, and then the fine-tuned electrical component symbol recognition model can be quantized to obtain a more accurate target electrical component symbol recognition model, which is beneficial to improving the recognition results for electrical component symbols and achieving the purpose of more accurate and efficient electrical component symbol recognition.
[0114] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0115] In one embodiment, a device for identifying electrical component symbols based on segmentation technology is provided, and the device for identifying electrical component symbols based on segmentation technology corresponds one-to-one to the method for identifying electrical component symbols based on segmentation technology in the above embodiment. Figure 7 As shown, the electrical component symbol recognition device based on segmentation technology includes an acquisition module 101, a first processing module 102, a second processing module 103, a third processing module 104 and a fourth processing module 105. The functional modules are described in detail as follows:
[0116] An acquisition module 101 is used for the acquisition module, and is used to use the acquired electrical drawing set and electrical component annotated image set as a training data set;
[0117] The first processing module 102 is used to construct and obtain an initial electrical component symbol recognition model based on the image encoder, the hint encoder and the mask decoder;
[0118] A second processing module 103 is used to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model;
[0119] A third processing module 104 is used to fine-tune the reference electrical component symbol recognition model based on the training data set to obtain a fine-tuned electrical component symbol recognition model;
[0120] The fourth processing module 105 is used to perform quantization processing on the fine-tuned electrical component symbol recognition model to obtain a target electrical component symbol recognition model.
[0121] In one embodiment, the second processing module 103 is used to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model, specifically for:
[0122] Performing image processing on each training data in the training data set by using an image encoder in the initial electrical component symbol recognition model to obtain an electrical component feature image set;
[0123] By using the prompt encoder in the initial electrical component symbol recognition model, each electrical component feature image in the electrical component feature image set is embedded to obtain an embedded electrical component feature image set;
[0124] Decoding each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result;
[0125] The initial electrical component symbol recognition model is trained according to the electrical component recognition result to obtain a reference electrical component symbol recognition model.
[0126] In one embodiment, the second processing module 103 is used to decode each embedded electrical component feature image in the embedded electrical component feature image set through a mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result, specifically for:
[0127] Initializing each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an initialized electrical component feature image set;
[0128] Up-sampling each of the initialized electrical component feature images in the initialized electrical component feature image set is performed by a mask decoder in the initial electrical component symbol recognition model to obtain a high-dimensional electrical component feature image set;
[0129] Performing convolution processing on each high-dimensional electrical component feature image in the high-dimensional electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain a multi-scale electrical component feature image set;
[0130] Performing feature fusion processing on each multi-scale electrical component feature image in the multi-scale electrical component feature image set through a mask decoder in the initial electrical component symbol recognition model to obtain a fused electrical component feature image set;
[0131] Through the mask decoder in the initial electrical component symbol recognition model, segmentation processing is performed on each fused electrical component feature image in the fused electrical component feature image set based on the segmentation technology to obtain an electrical component recognition result.
[0132] In one embodiment, the third processing module 104 is used to fine-tune the reference electrical component symbol recognition model based on the training data set to obtain a fine-tuned electrical component symbol recognition model, specifically for:
[0133] Performing diversification processing on each training data in the training data set to obtain diversified data;
[0134] Performing labeling processing on the diversified data to obtain fine-tuned training data;
[0135] According to the goal of fine-tuning processing, determine the fine-tuning loss function term;
[0136] The reference electrical component symbol recognition model is fine-tuned according to the fine-tuning loss function term, the fine-tuning training data and the fine-tuning training parameters to obtain a fine-tuning electrical component symbol recognition model.
[0137] In one embodiment, the fourth processing module 105 is used to perform quantization processing on the fine-tuned electrical component symbol recognition model to obtain a target electrical component symbol recognition model, specifically for:
[0138] Analyzing the structure of the fine-tuning electrical component symbol recognition model to obtain module importance assessment data;
[0139] Determine the quantitative accuracy data according to the module importance evaluation data and performance requirement data;
[0140] Analyzing the parameters of the fine-tuning electrical component symbol recognition model to obtain parameter analysis data;
[0141] Analyze the data according to the parameters and determine the quantitative range data;
[0142] According to the quantization accuracy data and the quantization range data, the fine-tuning electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
[0143] The present invention provides an electrical component symbol recognition device based on segmentation technology. The device uses an acquired electrical drawing set and an electrical component annotation image set as a training data set, and constructs and obtains an initial electrical component symbol recognition model based on an image encoder, a prompt encoder and a mask decoder. The initial electrical component symbol recognition model is trained based on the training data set to obtain a reference electrical component symbol recognition model. The reference electrical component symbol recognition model can be fine-tuned based on the training data set to obtain a fine-tuned electrical component symbol recognition model. The fine-tuned electrical component symbol recognition model can then be quantized to obtain a more accurate target electrical component symbol recognition model, which is beneficial to improving the recognition results for electrical component symbols and achieving the purpose of more accurate and efficient electrical component symbol recognition.
[0144] The specific definition of the electrical component symbol recognition device based on segmentation technology can be found in the above definition of the electrical component symbol recognition method based on segmentation technology, which will not be repeated here. Each module in the above-mentioned electrical component symbol recognition device based on segmentation technology can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0145] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps on the service side of an electrical component symbol recognition method based on segmentation technology are implemented.
[0146] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, it realizes the functions or steps of the client side of an electrical component symbol recognition method based on segmentation technology.
[0147] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0148] The obtained electrical drawing set and electrical component annotated image set are used as a training data set;
[0149] Based on the image encoder, the hint encoder and the mask decoder, an initial electrical component symbol recognition model is constructed and obtained;
[0150] Based on the training data set, the initial electrical component symbol recognition model is trained to obtain a reference electrical component symbol recognition model;
[0151] Based on the training data set, fine-tuning the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model;
[0152] The fine-tuned electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
[0153] The present invention provides a computer device, which uses an acquired electrical drawing set and an electrical component annotated image set as a training data set, and constructs and obtains an initial electrical component symbol recognition model based on an image encoder, a prompt encoder and a mask decoder, so as to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model, so that the reference electrical component symbol recognition model can be fine-tuned based on the training data set to obtain a fine-tuned electrical component symbol recognition model, and then the fine-tuned electrical component symbol recognition model can be quantized to obtain a more accurate target electrical component symbol recognition model, which is beneficial to improving the recognition results for electrical component symbols and achieving the purpose of more accurate and efficient electrical component symbol recognition.
[0154] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0155] The obtained electrical drawing set and electrical component annotated image set are used as a training data set;
[0156] Based on the image encoder, the hint encoder and the mask decoder, an initial electrical component symbol recognition model is constructed and obtained;
[0157] Based on the training data set, the initial electrical component symbol recognition model is trained to obtain a reference electrical component symbol recognition model;
[0158] Based on the training data set, fine-tuning the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model;
[0159] The fine-tuned electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
[0160] The present invention provides a computer-readable storage medium, which uses an acquired electrical drawing set and an electrical component annotated image set as a training data set, and constructs and obtains an initial electrical component symbol recognition model based on an image encoder, a prompt encoder and a mask decoder, so as to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model, so that the reference electrical component symbol recognition model can be fine-tuned based on the training data set to obtain a fine-tuned electrical component symbol recognition model, and then the fine-tuned electrical component symbol recognition model can be quantized to obtain a more accurate target electrical component symbol recognition model, which is beneficial to improving the recognition results for electrical component symbols and achieving the purpose of more accurate and efficient electrical component symbol recognition.
[0161] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0162] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0163] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0164] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for identifying electrical component symbols based on segmentation technology, characterized in that: The method comprises: The obtained electrical drawing set and electrical component annotated image set are used as a training data set; Based on the image encoder, the hint encoder and the mask decoder, an initial electrical component symbol recognition model is constructed and obtained; Based on the training data set, the initial electrical component symbol recognition model is trained to obtain a reference electrical component symbol recognition model; Based on the training data set, fine-tuning the reference electrical component symbol recognition model to obtain a fine-tuned electrical component symbol recognition model; The fine-tuned electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
2. The electrical component symbol recognition method based on segmentation technology according to claim 1, characterized in that: The step of training the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model includes: Performing image processing on each training data in the training data set by using an image encoder in the initial electrical component symbol recognition model to obtain an electrical component feature image set; By using the prompt encoder in the initial electrical component symbol recognition model, each electrical component feature image in the electrical component feature image set is embedded to obtain an embedded electrical component feature image set; Decoding each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result; The initial electrical component symbol recognition model is trained according to the electrical component recognition result to obtain a reference electrical component symbol recognition model.
3. The electrical component symbol recognition method based on segmentation technology according to claim 2 is characterized in that: The method of decoding each embedded electrical component feature image in the embedded electrical component feature image set by using the mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result includes: Initializing each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an initialized electrical component feature image set; Up-sampling each of the initialized electrical component feature images in the initialized electrical component feature image set is performed by a mask decoder in the initial electrical component symbol recognition model to obtain a high-dimensional electrical component feature image set; Performing convolution processing on each high-dimensional electrical component feature image in the high-dimensional electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain a multi-scale electrical component feature image set; Performing feature fusion processing on each multi-scale electrical component feature image in the multi-scale electrical component feature image set through a mask decoder in the initial electrical component symbol recognition model to obtain a fused electrical component feature image set; Through the mask decoder in the initial electrical component symbol recognition model, segmentation processing is performed on each fused electrical component feature image in the fused electrical component feature image set based on the segmentation technology to obtain an electrical component recognition result.
4. The electrical component symbol recognition method based on segmentation technology according to claim 3 is characterized in that: The step of fine-tuning the reference electrical component symbol recognition model based on the training data set to obtain a fine-tuned electrical component symbol recognition model includes: Performing diversification processing on each training data in the training data set to obtain diversified data; Performing labeling processing on the diversified data to obtain fine-tuned training data; According to the goal of fine-tuning processing, determine the fine-tuning loss function term; The reference electrical component symbol recognition model is fine-tuned according to the fine-tuning loss function term, the fine-tuning training data and the fine-tuning training parameters to obtain a fine-tuning electrical component symbol recognition model.
5. The electrical component symbol recognition method based on segmentation technology according to any one of claims 1 to 4, characterized in that: The step of quantizing the fine-tuned electrical component symbol recognition model to obtain a target electrical component symbol recognition model includes: Analyzing the structure of the fine-tuning electrical component symbol recognition model to obtain module importance assessment data; Determine the quantitative accuracy data according to the module importance evaluation data and performance requirement data; Analyzing the parameters of the fine-tuning electrical component symbol recognition model to obtain parameter analysis data; Analyze the data according to the parameters and determine the quantitative range data; According to the quantization accuracy data and the quantization range data, the fine-tuning electrical component symbol recognition model is quantized to obtain a target electrical component symbol recognition model.
6. An electrical component symbol recognition device based on segmentation technology, characterized in that: The electrical component symbol recognition device based on segmentation technology includes: An acquisition module, used to use the acquired electrical drawing set and electrical component annotated image set as a training data set; A first processing module is used for constructing and obtaining an initial electrical component symbol recognition model based on an image encoder, a hint encoder and a mask decoder; A second processing module, configured to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model; A third processing module is used to fine-tune the reference electrical component symbol recognition model based on the training data set to obtain a fine-tuned electrical component symbol recognition model; The fourth processing module is used to perform quantization processing on the fine-tuned electrical component symbol recognition model to obtain a target electrical component symbol recognition model.
7. The electrical component symbol recognition device based on segmentation technology according to claim 6 is characterized in that: The second processing module is used to train the initial electrical component symbol recognition model based on the training data set to obtain a reference electrical component symbol recognition model, specifically for: Performing image processing on each training data in the training data set by using an image encoder in the initial electrical component symbol recognition model to obtain an electrical component feature image set; By using the prompt encoder in the initial electrical component symbol recognition model, each electrical component feature image in the electrical component feature image set is embedded to obtain an embedded electrical component feature image set; Decoding each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result; The initial electrical component symbol recognition model is trained according to the electrical component recognition result to obtain a reference electrical component symbol recognition model.
8. The electrical component symbol recognition device based on segmentation technology according to claim 7, characterized in that: The second processing module is used to decode each embedded electrical component feature image in the embedded electrical component feature image set through a mask decoder in the initial electrical component symbol recognition model to obtain an electrical component recognition result, specifically for: Initializing each embedded electrical component feature image in the embedded electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain an initialized electrical component feature image set; Up-sampling each of the initialized electrical component feature images in the initialized electrical component feature image set is performed by a mask decoder in the initial electrical component symbol recognition model to obtain a high-dimensional electrical component feature image set; Performing convolution processing on each high-dimensional electrical component feature image in the high-dimensional electrical component feature image set by using a mask decoder in the initial electrical component symbol recognition model to obtain a multi-scale electrical component feature image set; Performing feature fusion processing on each multi-scale electrical component feature image in the multi-scale electrical component feature image set through a mask decoder in the initial electrical component symbol recognition model to obtain a fused electrical component feature image set; Through the mask decoder in the initial electrical component symbol recognition model, segmentation processing is performed on each fused electrical component feature image in the fused electrical component feature image set based on the segmentation technology to obtain an electrical component recognition result.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electrical component symbol recognition method based on segmentation technology as described in any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the electrical component symbol recognition method based on segmentation technology as described in any one of claims 1 to 5 is implemented.