Wiring diagram identification method and storage medium
Through the combination of graphic elements and text recognition models, automatic recognition of substation wiring diagrams is realized, solving the problems of low efficiency and low accuracy of manual recognition, improving the speed and accuracy of recognition, and supporting more efficient operation, maintenance and faults. Check.
Patent Information
- Application Number
- CN202410629399.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-03
AI Technical Summary
In the existing technology, the identification of primary equipment wiring diagrams in substations mainly relies on manual labor, which is inefficient and inaccurate, making it difficult to meet the needs of daily maintenance and troubleshooting.
The graph element recognition model and the text recognition model are used to automatically recognize the wiring diagram. The graph element recognition model identifies the graph elements, and the text recognition model recognizes the text, and performs matching to achieve fast and accurate recognition of the wiring diagram.
It achieves fast and accurate identification of wiring diagrams, improves the work efficiency of substation operation and maintenance personnel, reduces manual errors, and provides a more reliable basis for troubleshooting and maintenance.
Smart Images

Figure CN118587732A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to a wiring diagram recognition method and a storage medium. Background Art
[0002] The substation primary equipment wiring diagram is a display diagram used to show the location, wiring method and connection method of electrical primary equipment. Through the substation primary equipment wiring diagram, you can clearly understand the electrical design of the substation and the connection method of the primary equipment, which helps operation and maintenance personnel to perform daily maintenance and troubleshooting of the substation. It is also an important basis and reference for substation construction and renovation.
[0003] During the operation of the substation, the wiring diagram of the substation primary equipment needs to be identified to complete daily maintenance and troubleshooting. At present, this identification process is mainly based on manual implementation, but the efficiency and accuracy of manual identification are low, which needs to be improved. Summary of the invention
[0004] The embodiments of the present invention provide a wiring diagram recognition method, device, electronic device and storage medium to realize automatic recognition of a target wiring diagram, thereby realizing rapid and accurate recognition of the target wiring diagram.
[0005] According to one aspect of the present invention, a wiring diagram recognition method is provided, which may include:
[0006] Obtaining a target wiring diagram to be identified and a pre-trained primitive recognition model and text recognition model;
[0007] Recognize the graphic elements in the target wiring diagram based on the graphic element recognition model to obtain at least one graphic element, and recognize the text in the target wiring diagram based on the text recognition model to obtain at least one text;
[0008] Matching at least one graphic element with at least one text to obtain a matching result, and identifying a connection line in a target wiring diagram based on the at least one graphic element and the at least one text;
[0009] A recognition result of a target wiring diagram is obtained according to at least one graphic element, at least one text, a matching result and a connecting line.
[0010] According to another aspect of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored. The computer instructions are used to enable a processor to implement the wiring diagram recognition method provided by any embodiment of the present invention when executed.
[0011] The technical solution of the embodiment of the present invention obtains the target wiring diagram to be identified and the pre-trained primitive recognition model and text recognition model, so that the target wiring diagram can be quickly and accurately identified by the primitive recognition model and the text recognition model; the primitives in the target wiring diagram are identified based on the primitive recognition model to obtain at least one primitive, and the texts in the target wiring diagram are identified based on the text recognition model to obtain at least one text, and the primitives and texts can be quickly and accurately identified by using the model; at least one primitive is matched with at least one text to obtain a matching result, and according to at least one primitive and at least one text, the connecting lines in the target wiring diagram are identified to better display the recognition results and facilitate the understanding of relevant technical personnel; according to at least one primitive, at least one text, the matching result and the connecting line, the recognition result of the target wiring diagram is obtained. The above technical solution identifies the primitives in the target wiring diagram by the primitive recognition model, and identifies the texts in the target wiring diagram by the text recognition model, and matches the identified primitives and texts. Compared with the manual recognition solution, this automatic recognition solution can realize the rapid and accurate recognition of the target wiring diagram.
[0012] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1 is a flow chart of a wiring diagram identification method provided according to an embodiment of the present invention;
[0015] Figure 2 is a flow chart of another wiring diagram identification method provided according to an embodiment of the present invention;
[0016] Figure 3 is a flow chart of another wiring diagram identification method provided according to an embodiment of the present invention;
[0017] Figure 4 is a structural diagram of a primitive receptive field enhancement module provided according to an embodiment of the present invention;
[0018] Figure 5 is a structural diagram of a feature enhancement module provided according to an embodiment of the present invention;
[0019] Figure 6 is a structural diagram of a first receptive field enhancement module provided according to an embodiment of the present invention;
[0020] Figure 7 is a recognition flow chart of a specific example in another wiring diagram recognition method provided by an embodiment of the present invention;
[0021] Figure 8 It is a training flow chart of a primary equipment electrical component primitive detection model according to a specific example in another wiring diagram recognition method provided in an embodiment of the present invention;
[0022] Fig. 9 is a structural diagram of a primary equipment electrical component primitive detection model specifically exemplified in another wiring diagram recognition method provided in an embodiment of the present invention;
[0023] Fig.10 is a flowchart of a text recognition model training according to a specific example of another wiring diagram recognition method provided by an embodiment of the present invention;
[0024] Fig.11 is a structural diagram of a text recognition model according to a specific example in another wiring diagram recognition method provided by an embodiment of the present invention;
[0025] Fig.12 It is a flowchart of connection line identification in a wiring diagram of a substation primary equipment according to a specific example of another wiring diagram identification method provided in an embodiment of the present invention;
[0026] Fig.13 It is a flowchart of matching primary equipment electrical component primitives and texts according to a specific example of another wiring diagram recognition method provided in an embodiment of the present invention;
[0027] Fig.14 is a structural block diagram of a wiring diagram recognition device provided according to an embodiment of the present invention;
[0028] Fig.15 The invention is a structural block diagram of an electronic device for implementing the wiring diagram recognition method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0032] Figure 1 This is a flow chart of a wiring diagram recognition method provided by an embodiment of the present invention. This embodiment can be applied to the case of wiring diagram recognition, and in particular, can be applied to the case of primary equipment wiring diagram recognition in a substation. The method can be executed by a wiring diagram recognition device provided by an embodiment of the present invention, and the device can be implemented by software and / or hardware, and the device can be integrated in an electronic device, and the electronic device can be various user terminals or servers.
[0033] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:
[0034] S110, obtaining a target wiring diagram to be identified and a pre-trained primitive recognition model and text recognition model.
[0035] Among them, the target wiring diagram can be understood as the wiring diagram that needs to be identified. Optionally, the target wiring diagram can be the primary equipment wiring diagram of the substation. By identifying the primary equipment wiring diagram, the electrical component elements, text annotations and connecting lines of the primary equipment of the substation can be clearly understood, which is helpful for operation and maintenance personnel to perform daily maintenance and troubleshooting of the substation, and at the same time provides important basis and reference for the construction and renovation of the substation.
[0036] The primitive recognition model can be understood as a pre-trained model for recognizing primitives in a target wiring diagram. Optionally, when the target wiring diagram is a primary device wiring diagram, the primitive recognition model can recognize the primary device electrical component primitives in the target wiring diagram.
[0037] The text recognition model can be understood as a pre-trained model used to recognize text in a target wiring diagram.
[0038] The target wiring diagram and the pre-trained primitive recognition model and text recognition model are obtained to further recognize the target wiring diagram through the primitive recognition model and the text recognition model.
[0039] S120, identifying graphics elements in the target wiring diagram based on the graphics element recognition model to obtain at least one graphics element, and identifying texts in the target wiring diagram based on the text recognition model to obtain at least one text.
[0040] The target wiring diagram can be identified by a graphic element recognition model to obtain at least one graphic element in the target wiring diagram, and the text in the target wiring diagram can be identified by a text recognition model to obtain at least one text. Optionally, after the target wiring diagram is identified by a graphic element recognition model, the graphic element type of the graphic element, such as a motor, a switch, a socket, a fuse, a resistor, a capacitor, an inductor, and a transformer, and a regression box of the location of the graphic element can be obtained; the text in the target wiring diagram can be identified by a text recognition model to obtain a regression box of the location of the text, and the text in the regression box can be identified to obtain at least one text.
[0041] S130, matching at least one graphic element with at least one text to obtain a matching result, and identifying a connection line in a target wiring diagram according to the at least one graphic element and the at least one text.
[0042] After the image element and the text are identified, the image element and the text may be matched to obtain a matching result, so as to understand the image element that directly matches the text.
[0043] At the same time, the connection lines in the target wiring diagram can also be identified based on at least one graphic element and at least one text. Optionally, the area where the graphic element and text are located in the target wiring diagram can be removed, and only the connection line diagram of the connection lines is retained, and the connection line diagram G is image enhanced, for example, using Gaussian filtering and smoothing to remove noise in the substation connection line diagram G. After that, the connection line diagram is binarized, and then the edge of the connection line diagram is smoothed to make the edge of the connection line diagram smooth. Finally, the Sobel-Federman operator is used to perform edge detection on the connection line diagram to obtain the connection lines.
[0044] S140: Obtain a recognition result of a target wiring diagram according to at least one graphic element, at least one text, a matching result, and a connecting line.
[0045] The recognition result of the target wiring diagram can be obtained based on the at least one recognized graphic element, at least one text, matching result and connecting line. For example, the category of the graphic element, the position of the graphic element and the text matching the graphic element can be displayed in a table form, and the outline of the recognized connecting line can be marked.
[0046] The technical solution of the embodiment of the present invention obtains the target wiring diagram to be identified and the pre-trained primitive recognition model and text recognition model, so that the target wiring diagram can be quickly and accurately identified by the primitive recognition model and the text recognition model; the primitives in the target wiring diagram are identified based on the primitive recognition model to obtain at least one primitive, and the texts in the target wiring diagram are identified based on the text recognition model to obtain at least one text, and the primitives and texts can be quickly and accurately identified by using the model; at least one primitive is matched with at least one text to obtain a matching result, and according to at least one primitive and at least one text, the connecting lines in the target wiring diagram are identified to better display the recognition results and facilitate the understanding of relevant technical personnel; according to at least one primitive, at least one text, the matching result and the connecting line, the recognition result of the target wiring diagram is obtained. The above technical solution identifies the primitives in the target wiring diagram by the primitive recognition model, and identifies the texts in the target wiring diagram by the text recognition model, and matches the identified primitives and texts. Compared with the manual recognition solution, this automatic recognition solution can realize the rapid and accurate recognition of the target wiring diagram.
[0047] An optional technical solution matches at least one graphic element with at least one text to obtain a matching result, including: obtaining the text center position of each text in at least one text; for each graphic element in at least one graphic element, obtaining the graphic element center position of the graphic element, and determining the distance between the graphic element center position and the center positions of each obtained text; based on the distance, determining the text in at least one text that matches the graphic element to obtain a matching result.
[0048] The center position of the primitive can be understood as the position of the center point of the primitive. Optionally, the center position of the primitive can be represented by the coordinates of the center position of the primitive, and the coordinates of the center position of the primitive can be determined in the following way: first, the location information of the regression box of the location of the primitive is obtained by the primitive recognition model, and the coordinates of the four corners of the regression box are determined; then the coordinates of the center position of the primitive are determined by the following formula:
[0049]
[0050] Among them, z is the coordinate of the center position of the primitive, the upper left vertex of the recognition frame is recorded as A, and the remaining vertices are recorded as B, C, and D in a clockwise direction. A is the horizontal coordinate of A, x B is the horizontal coordinate of B, y A is the ordinate of A, y D is the vertical coordinate of D.
[0051] The text center position can be understood as the position of the text center point. Optionally, the text center position can be represented by the coordinates of the text center position, and the method for determining the text center position coordinates is the same as the method for determining the primitive center position coordinates.
[0052] After obtaining the text center position of each text and the graphic center position of each graphic element, the distance between the graphic element center position and the text center position can be determined for each graphic element. Optionally, when the graphic element center position and the text center position are expressed in coordinates, the distance can be calculated in the following way:
[0053]
[0054] Among them, F(i) is the distance, S is the coordinate of the center position of the element, T i is the coordinate of the center of the text, x S is the horizontal coordinate of the center position of the primitive, is the horizontal coordinate of the center of the text, y S is the vertical coordinate of the center position of the primitive, The vertical coordinate of the center of the text.
[0055] After obtaining the distance, the text that matches the primitive in at least one text can be determined according to the distance to obtain a matching result. Optionally, the primitive and text that are closest in distance can be matched. When the center position of the primitive and the center position of the text are expressed in coordinates, the text closest to the center position of the primitive can be determined by the following formula:
[0056] I = argmin(F(i))
[0057] Where I is the text area closest to the center of the primitive. Optionally, a distance threshold thresh can be set:
[0058] When F(i)≤thresh, the primary device electrical component primitive S matches the text area I.
[0059] When F(i)>thresh, the primary device electrical component primitive S does not match the text area I.
[0060] The purpose of setting thresh is to prevent the distance between the primitive S and the text area I from being too far, which would lead to incorrect matching.
[0061] The above technical solution accurately matches the graphic element and text through the center position of the text and the center position of the graphic element, which is convenient for relevant technical personnel to better understand the graphic element through the text.
[0062] Figure 2 It is a flow chart of another wiring diagram recognition method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the primitive recognition model includes a primitive feature extraction network, and the primitive feature extraction network includes a primitive convolution module and a primitive receptive field enhancement module; based on the primitive recognition model, the primitives in the target wiring diagram are recognized to obtain at least one primitive, including: using the primitive convolution module to extract features of the target wiring diagram to obtain a primitive feature image; using the primitive receptive field enhancement module to process the primitive feature image to associate each pixel point in the primitive feature image with a pixel point other than a pixel point in the primitive feature image, respectively, to obtain a primitive enhanced feature image; according to the primitive enhanced feature image, the primitives in the target wiring diagram are recognized to obtain at least one primitive. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0063] See also Figure 2 The method of this embodiment may specifically include the following steps:
[0064] S210, obtaining a target wiring diagram to be identified and a pre-trained primitive recognition model and text recognition model, wherein the primitive recognition model includes a primitive feature extraction network, and the primitive feature extraction network includes a primitive convolution module and a primitive receptive field enhancement module.
[0065] The primitive feature extraction network can be understood as a network for extracting primitive features in the target wiring diagram. Optionally, the primitive feature extraction network can include a primitive convolution module for feature extraction and a primitive receptive field enhancement module for enhancing the receptive field of primitive features.
[0066] S220, using a primitive convolution module to extract features of the target wiring diagram to obtain a primitive feature image.
[0067] The primitive convolution module can be understood as a module in the primitive feature extraction network that extracts primitive features of the target wiring diagram through convolution processing. Optionally, a multi-layer primitive convolution module can be set to extract features of the target wiring diagram, effectively extracting low-level image features of the target wiring diagram into high-level image features.
[0068] The primitive convolution module can be used to extract features of the target wiring diagram to obtain a primitive feature image.
[0069] S230, using the primitive receptive field enhancement module to process the primitive feature image, so as to associate each pixel point in the primitive feature image with the pixel points other than the pixel point in the primitive feature image, and obtain a primitive enhanced feature image.
[0070] The primitive receptive field enhancement module can be understood as a module that associates each pixel in the primitive feature image with pixels other than the pixel in the primitive feature image to improve the global receptive field of each pixel in the primitive feature image. By processing the primitive feature image using the primitive receptive field enhancement module, more global context information in the primitive feature image can be captured while maintaining the accuracy of local details.
[0071] By processing the primitive feature image using the primitive receptive field enhancement module, each pixel point in the primitive feature image can be associated with pixel points other than the pixel point in the primitive feature image to obtain a primitive enhanced feature image.
[0072] S240 , identifying the graphic elements in the target wiring diagram according to the graphic element enhanced feature image, and obtaining at least one graphic element.
[0073] Among them, by recognizing the enhanced feature image of the graphic element, the graphic element in the target wiring diagram can be obtained more accurately.
[0074] S250: Recognize text in the target wiring diagram based on the recognition model to obtain at least one text.
[0075] S260: Match at least one graphic element with at least one text to obtain a matching result, and identify a connection line in the target wiring diagram according to the at least one graphic element and the at least one text.
[0076] S270: Obtain a recognition result of the target wiring diagram according to at least one graphic element, at least one text, the matching result, and the connecting line.
[0077] The technical solution of the embodiment of the present invention is to enhance the receptive field of the primitive feature image through the primitive receptive field enhancement module to obtain the primitive enhancement feature module. By identifying the primitive enhancement feature module, the primitive can be identified more accurately, thereby improving the accuracy of target wiring diagram identification.
[0078] An optional technical solution is to process a primitive feature image to associate each pixel in the primitive feature image with a pixel other than the pixel in the primitive feature image to obtain a primitive enhanced feature image, including: taking the primitive feature image as the first feature image, and performing convolution processing on the primitive feature image to obtain a second feature image, a third feature image, and a fourth feature image; transposing the fourth feature image, and multiplying the transposed fourth feature image with the third feature image to obtain a fifth feature image; multiplying the fifth feature image with the second feature image to obtain a sixth feature image; and adding the first feature image and the sixth feature image to associate each pixel in the primitive feature image with a pixel other than the pixel in the primitive feature image to obtain a primitive enhanced feature image.
[0079] Among them, the first feature image can be understood as a primitive feature image without any processing; the second feature image, the third feature image and the fourth feature image can be understood as the same feature images obtained after the primitive feature images are subjected to the same convolution processing.
[0080] The fourth feature image is transposed, and the transposed fourth feature image is multiplied with the third feature image to obtain the fifth feature image; the fifth feature image is multiplied with the second feature image to obtain the sixth feature image; the first feature image is added with the sixth feature image to associate each pixel in the primitive feature image with the pixel points other than the pixel points in the primitive feature image, thereby obtaining the primitive enhanced feature image.
[0081] Optionally, the structure of the primitive receptive field enhancement module is as follows Figure 4 As shown, if the size of the primitive feature image X is H×W×C. First, four branches are performed on the feature image X. In the first branch, no operation is performed on the feature image X, and a feature image X1 with the same size of H×W×C as the feature image X is obtained. In the second, third, and fourth branches, the feature image X passes through C / 2 1×1 convolution kernels, reducing the number of channels to C / 2, and three feature images X2, X3, and X4 with the same size of H×W×C / 2 are obtained. Among them, c1 is the convolution operation of the 1×1 convolution kernel,
[0082] X1=X
[0083] X2=X3=X4=c1(X)
[0084] Secondly, the feature image X4 with a size of H×W×C / 2 is transposed and matrix multiplied with the feature image X3 with a size of H×W×C / 2. The result of the matrix multiplication is then normalized to obtain the feature image X5 with a size of W×W×C / 2:
[0085] X5 = softmax(MP(X3, T(X4)))
[0086] Among them, T is matrix transpose, MP is matrix multiplication, and softmax is normalization processing.
[0087] Again, the feature image X5 with a size of W×W×C / 2 is matrix-multiplied with the feature image X2 with a size of H×W×C / 2, and then convolved using C 1×1 convolution kernels to obtain a feature image X6 with a size of H×W×C:
[0088] X6=c1(MP(X2,X5))
[0089] Finally, the feature images X1 and X6 of size H×W×C are added and input into the activation function to obtain the primitive enhanced feature image Y of size H×W×C output by the primitive receptive field enhancement module.
[0090] Y=RL(X1+X6)
[0091] Among them, Y is the primitive enhanced feature image output after the primitive receptive field enhancement module, and RL is the Rectified Linear Unit (ReLU) activation function.
[0092] The above technical solution obtains the primitive enhanced feature image through the primitive receptive field enhancement module, thereby realizing the enhancement of the receptive field of the primitive feature image.
[0093] Another optional technical solution is that the primitive feature extraction network also includes a feature enhancement module; based on the primitive enhanced feature image, the primitive in the target wiring diagram is identified to obtain at least one primitive, including: using the feature enhancement module to enhance the primitive enhanced feature image in a manner combining convolution operation with linear operation to obtain an enhanced feature image; based on the enhanced feature image, the primitive in the target wiring diagram is identified to obtain at least one primitive.
[0094] Among them, the feature enhancement module can be understood as a module for enhancing the features in the primitive enhancement feature image.
[0095] On the basis of obtaining the primitive enhanced feature image, a feature enhancement module can be used to enhance the features of the primitive enhanced feature image by combining convolution operation with linear operation to obtain an enhanced feature image, and then the feature enhanced image is further identified to obtain at least one primitive.
[0096] The above technical solution can improve the accuracy of identifying graphic elements in the target wiring diagram through further feature enhancement.
[0097] On this basis, optionally, the features of the primitive enhanced feature image are enhanced by combining convolution operation with linear operation to obtain an enhanced feature image, including: convolution processing on the primitive enhanced feature image to obtain a convolution feature image; linearly changing the convolution feature image to obtain a linear feature image; superimposing the convolution feature image and the linear feature image to achieve feature enhancement of the primitive enhanced feature image to obtain an enhanced feature image.
[0098] Among them, the primitive enhanced feature image can be convolved to obtain a convolution feature image; the convolution feature image can be linearly changed to obtain a linear feature image; the convolution feature image and the linear feature image can be superimposed to enhance the features of the primitive enhanced feature image to obtain an enhanced feature image. Optionally, the feature enhancement module combines convolution operation with linear operation to enhance the features of the primitive enhanced feature image. Figure 5 As shown, the specific steps may be:
[0099] (1) Input the primitive enhanced feature image X with a size of H×W×C, and use C / 2 1×1 convolution kernels to generate a feature image Y1 with a size of H×W×C / 2. The calculation formula is:
[0100] Y1=c1(X)
[0101] Among them, c1 is the convolution operation of 1×1 convolution kernel.
[0102] (2) Make a linear transformation on Y1 to obtain another feature image Y2 with a size of H×W×C / 2.
[0103] Y2=Φ(Y1)
[0104] Among them, Φ is a linear change.
[0105] (3) Y2 and Y1 are superimposed to obtain and output a feature-enhanced image Y of size H×W×C.
[0106] Y = Concat(Y1, Y2)
[0107] Among them, Concat is a superposition operation.
[0108] The above technical solution can achieve feature enhancement of primitive enhanced feature images by combining convolution operation with linear operation.
[0109] Figure 3It is a flow chart of another wiring diagram recognition method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the text recognition model includes a first feature extraction network, and the first feature extraction network includes a first convolution module and a first receptive field enhancement module; recognizing the text in the target wiring diagram based on the text recognition model to obtain at least one text, including: using the first convolution module to extract features of the target wiring diagram to obtain a text feature image; using the first receptive field enhancement module to process the text feature image to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image to obtain a text enhanced feature image; according to the text enhanced feature image, identifying the text in the target wiring diagram to obtain at least one text. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here. See. Figure 3 The method of this embodiment may specifically include the following steps:
[0110] S310, obtaining a target wiring diagram to be identified and a pre-trained primitive recognition model and a text recognition model, wherein the text recognition model includes a first feature extraction network, and the first feature extraction network includes a first convolution module and a first receptive field enhancement module.
[0111] The text recognition model may include a first feature extraction network for extracting text features in the target wiring diagram, and the first feature extraction network may include a first convolution module and a first receptive field enhancement module.
[0112] S320: Identify the graphic elements in the target wiring diagram based on the graphic element recognition model to obtain at least one graphic element.
[0113] S330: Using the first convolution module, extract features of the target wiring diagram to obtain a text feature image.
[0114] The first convolution module can be understood as a module in the first feature extraction network that extracts text features from the target wiring diagram through convolution processing. Optionally, multiple layers of the first convolution module can be set to extract text features from the target wiring diagram, effectively extracting low-level to high-level semantic features from the target wiring diagram.
[0115] The first convolution module can be used to extract features of the target wiring diagram to obtain a text feature image.
[0116] S340: Process the text feature image using the first receptive field enhancement module to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, thereby obtaining a text enhanced feature image.
[0117] Among them, the first receptive field enhancement module can be understood as a module for enhancing the receptive field in the text feature image. The receptive field of each pixel in the text feature image can be enhanced while maintaining the dimension of the text feature image to obtain a text enhanced feature image.
[0118] S350: Identify text in the target wiring diagram according to the text-enhanced feature image to obtain at least one text.
[0119] After obtaining the text-enhanced feature image, the text in the target wiring diagram may be further identified based on the text-enhanced feature image to obtain at least one text.
[0120] S360: Match at least one graphic element with at least one text to obtain a matching result, and identify a connection line in the target wiring diagram according to the at least one graphic element and the at least one text.
[0121] S370: Obtain a recognition result of the target wiring diagram according to at least one graphic element, at least one text, the matching result and the connecting line.
[0122] The technical solution of the embodiment of the present invention can better recognize the text in the target wiring diagram by performing receptive field enhancement on the text feature image through the first receptive field enhancement module.
[0123] An optional technical solution, a first receptive field enhancement module includes a receptive field primary enhancement unit and a receptive field secondary enhancement unit, processes a text feature image to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, and obtains a text enhanced feature image, including: using the receptive field primary enhancement unit to perform convolution processing on the text feature image, and performing batch normalization processing on the first convolution processing result to obtain a primary enhanced feature image; using the receptive field secondary enhancement unit to perform convolution processing on the primary enhanced feature image, and performing batch normalization processing on the second convolution processing result to obtain a secondary enhanced feature image; adding the primary enhanced feature image and the secondary enhanced feature image to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, and obtain a text enhanced feature image.
[0124] Among them, the receptive field primary enhancement unit can be understood as a unit that performs primary receptive field enhancement on the text feature image; the receptive field secondary enhancement unit can be understood as a unit that performs secondary receptive field enhancement on the text feature image.
[0125] The text feature image is convolved using the receptive field primary enhancement unit, and the first convolution processing result is batch normalized to obtain a primary enhanced feature image; the primary enhanced feature image is convolved using the receptive field secondary enhancement unit, and the second convolution processing result is batch normalized to obtain a secondary enhanced feature image; the primary enhanced feature image and the secondary enhanced feature image are added together to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, to obtain a text enhanced feature image. Optionally, the structure diagram of the first receptive field enhancement module is as follows: Figure 6 As shown, the specific processing steps are as follows:
[0126] (1) Input text feature image X, and obtain the initial enhanced feature image X1 after passing through a 3×3 convolution kernel, batch normalization and activation function.
[0127] X1=R1(BN(F 3×3 (X)))
[0128] Among them, F 3×3 is the convolution operation, Rl is the ReLu activation function, and BN is the batch normalization process. The number of channels of the feature image remains unchanged during this process.
[0129] (2) After X1 passes through a 3×3 convolution kernel, batch normalization and activation function, the secondary enhanced feature image X2 is obtained.
[0130] X2=R1(BN(F 3×3 (X1)))
[0131] (3) Finally, the characteristic images X1 and X2 are added together to obtain the characteristic image Y of the substation primary equipment wiring diagram and output it.
[0132] Y = add(X1, X2)
[0133] Where Y is the output text enhanced feature image, and add is the addition operation.
[0134] The above technical solution, by performing two receptive field enhancements on the text feature image and adding them together, can expand the receptive field of the pixel without changing the dimension of the original text feature image, thereby making the calculation more efficient and accurate while keeping the model structure simple.
[0135] Another optional technical solution is that the text recognition model also includes a second feature extraction network, the second feature extraction network includes a second convolution module and at least two second receptive field enhancement modules; according to the text enhancement feature image, the text in the target wiring diagram is identified to obtain at least one text, including: using the second convolution module to extract features from the text enhancement feature image, and using at least two second receptive field enhancement modules to enhance the receptive field based on the obtained feature extraction results to identify the text in the target wiring diagram and obtain at least one text.
[0136] The second feature extraction network can be understood as a network for performing text feature extraction on the text enhanced feature image again. Optionally, the second feature extraction network can include a second convolution module for performing convolution processing on the text enhanced feature image again and at least two second receptive field enhancement modules for performing receptive field enhancement on the text enhanced feature image again.
[0137] On the basis of obtaining the text enhanced feature image, the second convolution module can be used to perform feature extraction on the text enhanced feature image, and at least two second receptive field enhancement modules can be used to perform receptive field enhancement based on the obtained feature extraction results to identify the text in the target wiring diagram and obtain at least one text. Optionally, feature extraction can be performed multiple times based on the processing of the text enhanced feature image by the second feature extraction network to obtain more accurate text features.
[0138] The above technical solution, by extracting features from text-enhanced feature images through multiple feature extraction networks, can further expand the receptive field of the feature images and improve the accuracy of text recognition.
[0139] In order to better understand the wiring diagram recognition process described above as a whole, the following is an exemplary description with reference to a specific example. In this specific example, the target wiring diagram is a substation primary equipment wiring diagram, the graphic element is a primary equipment electrical component graphic element, and the graphic element recognition model is a primary equipment electrical component graphic element detection model. The specific recognition flow chart is as follows: Figure 7 As shown, the specific identification process is as follows:
[0140] 1. Train to obtain a device electrical component primitive detection model. The training process is as follows: Figure 8 Shown
[0141] 1.1. Constructing a dataset of electrical components of primary equipment
[0142] Collect the substation primary equipment wiring diagram and annotate the primary equipment electrical component primitives in the diagram. Construct a primary equipment electrical component primitive dataset from the annotated substation primary equipment wiring diagram. Specifically, 500 substation primary equipment wiring diagrams were used to construct a primary equipment electrical component primitive dataset for training the substation primary equipment wiring diagram. Figure 1 Secondary equipment electrical component primitive recognition model. Label the primary equipment electrical component primitives in the substation primary equipment wiring diagram dataset. The dataset is randomly divided into a training set and a validation set at a ratio of 3:1.
[0143] 1.2. Constructing a detection model for electrical components of primary equipment
[0144] Primary equipment electrical component element detection model Fig. 9 As shown. First, a substation primary equipment wiring diagram P0 is input. P0 is enhanced by the primitive receptive field enhancement module and feature enhancement module in the R1, R2, and R3 layers of the feature extraction network to obtain substation primary equipment wiring diagram feature images P1, P2, and P3 of different sizes. The three-layer structure feature extraction network of the primitive recognition model effectively extracts the low-level image features of the substation primary equipment wiring diagram to high-level image features. Then the feature images P1, P2, and P3 are input into the region proposal network (RPN) to obtain the target category and regression box of the electrical components of the primary equipment.
[0145] 1.3. Train a model for detecting electrical components of a device
[0146] The data in the training set is input into the primary equipment electrical component primitive detection model for training. The entire training process is set to 100 times (epoch), and the parameters in the model are adjusted according to the loss value in each iteration. After adjusting the relevant parameters, the primary equipment wiring of the substation is finally Figure 1 The accuracy of the electrical component primitive recognition model of secondary equipment tends to be stable, mainly fluctuating between 95% and 98%.
[0147] 1.4. Primary equipment electrical component graphic element detection model to identify the wiring diagram of primary equipment in substation
[0148] The substation primary equipment wiring diagram is input into the primary equipment electrical component graphic element detection model for automatic identification.
[0149] After the substation primary equipment wiring diagram is identified by the primary equipment electrical component graphic element detection model, the identified primary equipment electrical component graphic element category and the regression frame positioning information of the primary equipment electrical component graphic element will be obtained.
[0150] The identified information is saved in the primary equipment electrical component graphic element information table. The format of the primary equipment electrical component graphic element information table is as follows:
[0151] Serial number Primary equipment electrical component element category Element center coordinates Text Notes
[0152] 2. Train to obtain the text recognition model. The text recognition model training flow chart is as follows: Fig.10 Shown
[0153] 2.1. Constructing a text dataset of substation primary equipment wiring diagrams
[0154] Collect the substation primary equipment wiring diagram and annotate the text data in the diagram. Construct the substation primary equipment wiring diagram text dataset with the annotated substation primary equipment wiring diagram. Specifically, 300 substation primary equipment wiring diagrams are used to construct the substation primary equipment wiring diagram text dataset for training the text recognition model. Annotate the text in the substation primary equipment wiring diagram text dataset.
[0155] 2.2. Building a text recognition model
[0156] The structure diagram of the text recognition model is as follows Fig.11 As shown. First, input a substation primary equipment wiring diagram P0. After P0 is enhanced by the first receptive field enhancement module in the R1, R2, and R3 layers of the feature extraction network, feature images P1, P2, and P3 of the substation primary equipment wiring diagram of different sizes are obtained. The three-layer feature extraction network of the primitive recognition model effectively extracts the low-level image features of the substation primary equipment wiring diagram to high-level image features. Finally, the obtained text image features P1, P2, and P3 of different levels are input into the RPN to identify the text area and text information of the primary equipment wiring diagram. The detailed steps are as follows:
[0157] Input a substation primary equipment wiring diagram P0 with a size of 224×224×3. P0 passes through the first convolution layer (Conv1) of the feature extraction network R1 layer of the text recognition model to obtain the substation primary equipment wiring diagram feature image P1 with a size of 112×112×32.
[0158] The feature image P1 with a size of 112×112×32 obtained by the R1 layer is input into the second convolution layer (Conv2) of the R2 layer of the feature extraction network for convolution and standardization operations to obtain a substation primary equipment wiring diagram feature image P′1 with a size of 28×28×128. The obtained feature image P′1 is then input into two sequentially connected first receptive field enhancement modules to obtain a substation primary equipment wiring diagram text feature image P2 with a receptive field enhancement of 28×28×128. The purpose of this design is to further expand the receptive field of the feature image through continuous feature extraction and enhancement operations, thereby improving the accuracy of subsequent text recognition.
[0159] The feature image P2 with a size of 28×28×128 obtained by the R2 layer is input into the third convolution layer (Conv3) of the R3 layer of the feature extraction network for convolution and standardization operations to obtain a substation primary equipment wiring diagram feature image P′2 with a size of 7×7×1024. The obtained feature image P′2 is input into three consecutive first receptive field enhancement modules. The receptive field enhanced substation primary equipment wiring diagram text feature image P3 with a size of 7×7×1024 is obtained. Constructing the regional candidate network of the text recognition model
[0160] P1, P2, and P3 are input into the Region Proposal Network (RPN) to generate a series of text pre-selected boxes. The distance intersection over union (Dt-IOU) is introduced as the loss function of the region candidate network. The area between the predicted box and the true box is weighted to solve the possible deviation problem. Dt-IOU weights the area between the predicted box and the true box, and adds the distance between the center point of the predicted box and the true box as a penalty term to the loss function calculation to solve the possible deviation problem of IOU. The loss function L Dt-IOU By L IOU and the geometric loss L g The calculation formula is as follows:
[0161] L Dt-IOU =L IOU +λ g L g
[0162] Intersection ratio L IOU The calculation formula is as follows:
[0163]
[0164] Geometric loss L g is the bounding box position loss:
[0165]
[0166] L θ =1-cos(θ-θ gt )
[0167] L g =L Q +λ θ L θ
[0168] Among them, λ g is the loss weight, R is the predicted text box, R gt is a real text box, d 2 (c,c gt ) is the center point c of the predicted box and the center point c of the real box gt The Euclidean distance between θ is the weight of the rotation angle loss and the penalty term; p is the diagonal length of the minimum rectangle formed by the intersection of the detection box and the true box. Dt-IOU is scale invariant and can provide a moving direction for the detection box when the detection box does not overlap with the true box. When the detection box overlaps with the true box, Dt-IOU optimizes the distance between the detection box and the true box through the penalty term to give the optimal detection box.
[0169] At the same time, the generated pre-selected box and the feature image are transmitted to the region of interest pooling (ROI Pooling), and the most suitable regression box is selected from a series of text pre-selected boxes, and the text information in the regression box area is recognized by optical character recognition (OCR). Finally, the text regression box and text information in the wiring diagram of the primary equipment of the substation are output.
[0170] 2.3. Training the text recognition model
[0171] The constructed substation equipment wiring diagram text dataset is divided into training set and validation set at a ratio of 3:1. The text recognition model is trained. First, all neural network parameters are initialized and model-related training parameters are set. The training set and validation set data are divided into multiple batches. Each time, a batch of training set data is input into the model for training to obtain the training loss value of the batch. Then the validation set is input into the model in batches to obtain the corresponding batch loss value. The text recognition model automatically learns and adjusts parameters according to the batch loss value each time until the batch loss value tends to converge, and the model training is completed. Specifically, the data in the training set is input into the substation primary equipment wiring diagram text recognition model for training. The entire training process is set to 100 epochs, and the parameters in the model are adjusted according to the loss value in each iteration. Training results: After adjusting the relevant parameters, the accuracy of the substation primary equipment wiring diagram text recognition model tends to be stable, mainly fluctuating between 90% and 95%.
[0172] 2.4. Text recognition model to identify the wiring diagram of primary equipment in substation
[0173] Input the substation primary equipment wiring diagram for text recognition. Select the recognized text area and identify the text information in the text regression box. On this basis, mark the text regression box at the bottom right of the box diagram, and the marked content is unified as text notes.
[0174] 3. Identification of connection lines in the wiring diagram of primary equipment in substation
[0175] Substation primary equipment wiring diagram connection line identification flow chart as follows Fig.12 As shown in the figure, the primary equipment wiring diagram of the substation is input, the primary equipment electrical component primitives and the area where the text is located in the substation electrical equipment wiring diagram are removed, and the connection line diagram G that only retains the connection lines is obtained. The noise in the substation connection line diagram is removed by Gaussian filtering and smoothing, and the connection line diagram G is enhanced. The connection line diagram is binarized, and then the edge of the connection line diagram is smoothed to make the edge of the connection line diagram smooth. Finally, the sobel operator is used to detect the edge of the connection line diagram to obtain the connection line and save the connection line recognition result.
[0176] 4. Matching of primary equipment electrical component graphics and text
[0177] The flow chart of matching primary equipment electrical component graphics and text is as follows Fig.13 As shown, according to the center coordinates of the primary equipment electrical component graphic element and the center coordinates of the text, the distance between the primary equipment electrical component graphic element and the text is calculated, and based on the preset distance threshold, it is judged whether the primary equipment electrical component graphic element and the text can match, and finally the text is input into the text remarks of the primary equipment electrical component graphic element that matches it in the primary equipment electrical component graphic element information table in 1.4.
[0178] The above specific examples can realize the rapid and accurate identification of the wiring diagram of the primary equipment in the substation.
[0179] Fig.10 This is a structural block diagram of a wiring diagram recognition device provided in an embodiment of the present invention, and the device is used to execute the wiring diagram recognition method provided in any of the above embodiments. The device and the wiring diagram recognition method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the wiring diagram recognition device can refer to the embodiment of the above wiring diagram recognition method. Fig.10 The device may specifically include: a text recognition model acquisition module 410, a text acquisition module 420, a connection line recognition module 430 and a recognition result acquisition module 440.
[0180] The text recognition model acquisition module 410 is used to acquire the target wiring diagram to be recognized and the pre-trained primitive recognition model and text recognition model;
[0181] A text obtaining module 420, configured to identify a graphic element in the target wiring diagram based on a graphic element recognition model to obtain at least one graphic element, and to identify text in the target wiring diagram based on a text recognition model to obtain at least one text;
[0182] A connection line identification module 430 is used to match at least one graphic element with at least one text to obtain a matching result, and to identify a connection line in a target wiring diagram based on the at least one graphic element and the at least one text;
[0183] The recognition result obtaining module 440 is used to obtain the recognition result of the target wiring diagram according to at least one graphic element, at least one text, the matching result and the connecting line.
[0184] Optionally, the primitive recognition model includes a primitive feature extraction network, and the primitive feature extraction network includes a primitive convolution module and a primitive receptive field enhancement module;
[0185] The text obtaining module 420 includes:
[0186] A submodule for obtaining a primitive feature image is used to extract features of a target wiring diagram using a primitive convolution module to obtain a primitive feature image;
[0187] The primitive enhanced feature image obtaining submodule is used to process the primitive feature image by using the primitive receptive field enhancement module, so as to associate each pixel point in the primitive feature image with the pixel points other than the pixel point in the primitive feature image, and obtain the primitive enhanced feature image;
[0188] The graphic element obtaining submodule is used to identify the graphic elements in the target wiring diagram according to the graphic element enhanced feature image, and obtain at least one graphic element.
[0189] On this basis, optionally, a primitive enhanced feature image acquisition module includes:
[0190] A fourth feature image obtaining submodule is used to use the primitive feature image as the first feature image, and to perform convolution processing on the primitive feature image to obtain a second feature image, a third feature image, and a fourth feature image;
[0191] A fifth characteristic image obtaining submodule is used to perform a transposition process on the fourth characteristic image, and to perform a multiplication process on the fourth characteristic image after the transposition process and the third characteristic image to obtain a fifth characteristic image;
[0192] A sixth characteristic image obtaining submodule, used for multiplying the fifth characteristic image and the second characteristic image to obtain a sixth characteristic image;
[0193] The primitive enhanced feature image obtaining submodule is used to perform addition processing on the first feature image and the sixth feature image so as to associate each pixel point in the primitive feature image with the pixel points other than the pixel point in the primitive feature image to obtain the primitive enhanced feature image.
[0194] Optionally, the primitive feature extraction network further includes a feature enhancement module; the primitive acquisition submodule includes:
[0195] The enhanced feature image obtaining unit is used to enhance the features of the primitive enhanced feature image by combining convolution operation with linear operation using the feature enhancement module to obtain the enhanced feature image;
[0196] The graphic element obtaining unit is used to identify the graphic elements in the target wiring diagram according to the enhanced feature image and obtain at least one graphic element.
[0197] Optionally, the enhanced feature image obtaining unit includes:
[0198] A convolution feature image obtaining subunit is used to perform convolution processing on the primitive enhanced feature image to obtain a convolution feature image;
[0199] A linear feature image obtaining subunit is used to perform linear changes on the convolution feature image to obtain a linear feature image;
[0200] The enhanced feature image obtaining subunit is used to perform superposition processing on the convolution feature image and the linear feature image to achieve feature enhancement of the primitive enhanced feature image and obtain the enhanced feature image.
[0201] Alternatively, the text recognition model includes a first feature extraction network, the first feature extraction network includes a first convolution module and a first receptive field enhancement module; the text acquisition module 420 includes:
[0202] A text feature image obtaining submodule is used to extract features of the target wiring diagram using the first convolution module to obtain a text feature image;
[0203] A text enhancement feature image obtaining submodule is used to process the text feature image using the first receptive field enhancement module to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, thereby obtaining a text enhancement feature image;
[0204] The text acquisition submodule is used to recognize the text in the target wiring diagram according to the text enhanced feature image to obtain at least one text.
[0205] Optionally, the first receptive field enhancement module includes a receptive field primary enhancement unit and a receptive field secondary enhancement unit, and the text enhancement feature image acquisition submodule includes:
[0206] The first enhanced feature image obtaining unit is used to perform convolution processing on the text feature image using the receptive field first enhancement unit, and perform batch normalization processing on the obtained first convolution processing result to obtain the first enhanced feature image;
[0207] A secondary enhanced feature image obtaining unit is used to perform convolution processing on the primary enhanced feature image using the receptive field secondary enhancement unit, and perform batch normalization processing on the obtained second convolution processing result to obtain a secondary enhanced feature image;
[0208] The text enhancement feature image obtaining unit is used to perform addition processing on the primary enhancement feature image and the secondary enhancement feature image so as to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, thereby obtaining the text enhancement feature image.
[0209] Optionally, the text recognition model further includes a second feature extraction network, the second feature extraction network includes a second convolution module and at least two second receptive field enhancement modules;
[0210] The text gets submodules, including:
[0211] The text obtaining unit is used to use the second convolution module to perform feature extraction on the text enhancement feature image, and use at least two second receptive field enhancement modules to perform receptive field enhancement based on the obtained feature extraction results to identify the text in the target wiring diagram and obtain at least one text.
[0212] Optionally, the connection line identification module 430 includes:
[0213] A text center position obtaining submodule, used to obtain the text center position of each text in at least one text;
[0214] A distance determination submodule, used for obtaining the center position of the image element of the at least one image element, and determining the distance between the center position of the image element and the center positions of each obtained text;
[0215] The matching result obtaining submodule is used to determine the text that matches the graphic element in at least one text according to the distance, so as to obtain the matching result.
[0216] The wiring diagram recognition device provided in the embodiment of the present invention obtains the target wiring diagram to be recognized and the pre-trained primitive recognition model and text recognition model through the text recognition model acquisition module, so that the target wiring diagram can be quickly and accurately recognized through the primitive recognition model and the text recognition model later; through the text acquisition module, the primitives in the target wiring diagram are recognized based on the primitive recognition model to obtain at least one primitive, and the texts in the target wiring diagram are recognized based on the text recognition model to obtain at least one text, and the primitives and texts can be quickly and accurately recognized by using the model; through the connecting line recognition module, at least one primitive is matched with at least one text to obtain a matching result, and the connecting lines in the target wiring diagram are recognized based on at least one primitive and at least one text, so as to better display the recognition results and facilitate the understanding of relevant technical personnel; through the recognition result acquisition module, the recognition result of the target wiring diagram is obtained based on at least one primitive, at least one text, the matching result and the connecting line. The above-mentioned wiring diagram recognition device recognizes the graphics in the target wiring diagram through the graphics recognition model, and recognizes the text in the target wiring diagram through the text recognition model, and matches the recognized graphics and text. Compared with the manual recognition scheme, this automatic recognition scheme can realize fast and accurate recognition of the target wiring diagram.
[0217] The wiring diagram recognition device provided in the embodiment of the present invention can execute the wiring diagram recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0218] It is worth noting that in the embodiment of the above-mentioned wiring diagram identification device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0219] Fig.11 A schematic diagram of the structure of an electronic device 8 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components, their connections and relationships, and their functions herein are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0220] like Fig.11The electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0221] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0222] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the wiring diagram recognition method.
[0223] In some embodiments, the wiring diagram recognition method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the wiring diagram recognition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the wiring diagram recognition method in any other appropriate manner (e.g., by means of firmware).
[0224] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0225] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0226] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0227] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0228] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0229] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0230] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A wiring diagram recognition method, characterized in that: include: Obtaining a target wiring diagram to be identified and a pre-trained primitive recognition model and text recognition model; Recognize the graphic elements in the target wiring diagram based on the graphic element recognition model to obtain at least one graphic element, and recognize the text in the target wiring diagram based on the text recognition model to obtain at least one text; Matching the at least one graphic element with the at least one text to obtain a matching result, and identifying a connection line in the target wiring diagram according to the at least one graphic element and the at least one text; A recognition result of the target wiring diagram is obtained according to the at least one graphic element, the at least one text, the matching result and the connecting line.
2. The method according to claim 1, characterized in that: The primitive recognition model includes a primitive feature extraction network, and the primitive feature extraction network includes a primitive convolution module and a primitive receptive field enhancement module; The step of identifying the graphic elements in the target wiring diagram based on the graphic element recognition model to obtain at least one graphic element comprises: Using the primitive convolution module, extracting features from the target wiring diagram to obtain a primitive feature image; Using the primitive receptive field enhancement module, the primitive feature image is processed to associate each pixel point in the primitive feature image with a pixel point other than the pixel point in the primitive feature image, to obtain a primitive enhanced feature image; According to the graphic element enhanced feature image, the graphic elements in the target wiring diagram are identified to obtain at least one graphic element.
3. The method according to claim 2, characterized in that The processing of the primitive feature image to associate each pixel point in the primitive feature image with a pixel point other than the pixel point in the primitive feature image to obtain a primitive enhanced feature image includes: Using the primitive feature image as a first feature image, and performing convolution processing on the primitive feature image to obtain a second feature image, a third feature image, and a fourth feature image; Transposing the fourth characteristic image, and multiplying the fourth characteristic image after the transposition processing with the third characteristic image to obtain a fifth characteristic image; multiplying the fifth characteristic image by the second characteristic image to obtain a sixth characteristic image; The first feature image and the sixth feature image are added together to associate each pixel point in the primitive feature image with a pixel point other than the pixel point in the primitive feature image, so as to obtain a primitive enhanced feature image.
4. The method according to claim 2, characterized in that: The primitive feature extraction network also includes a feature enhancement module; The step of identifying the graphic element in the target wiring diagram according to the graphic element enhanced feature image to obtain at least one graphic element comprises: Using the feature enhancement module, the feature enhancement of the primitive enhanced feature image is performed in a manner of combining convolution operation with linear operation to obtain an enhanced feature image; According to the enhanced feature image, the graphic elements in the target wiring diagram are identified to obtain at least one graphic element.
5. The method according to claim 4, characterized in that The method of combining convolution operation with linear operation to enhance the features of the primitive enhanced feature image to obtain the enhanced feature image includes: Performing convolution processing on the primitive enhanced feature image to obtain a convolution feature image; Performing a linear change on the convolution feature image to obtain a linear feature image; The convolution feature image and the linear feature image are superimposed to enhance the features of the primitive enhanced feature image and obtain an enhanced feature image.
6. The method according to claim 1, characterized in that The text recognition model includes a first feature extraction network, which includes a first convolution module and a first receptive field enhancement module; The step of recognizing text in the target wiring diagram based on the text recognition model to obtain at least one text includes: Using the first convolution module, extracting features from the target wiring diagram to obtain a text feature image; Using the first receptive field enhancement module, the text feature image is processed to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, thereby obtaining a text enhanced feature image; According to the text-enhanced feature image, the text in the target wiring diagram is identified to obtain at least one text.
7. The method according to claim 6, characterized in that The first receptive field enhancement module includes a receptive field primary enhancement unit and a receptive field secondary enhancement unit, and the processing of the text feature image to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image to obtain a text enhanced feature image includes: Using the receptive field primary enhancement unit, the text feature image is convolved, and the obtained first convolution result is batch normalized to obtain a primary enhanced feature image; Using the receptive field secondary enhancement unit, convolution processing is performed on the primary enhanced feature image, and batch normalization processing is performed on the obtained second convolution processing result to obtain a secondary enhanced feature image; The first enhanced feature image and the second enhanced feature image are added together to enhance the receptive field of each pixel in the text feature image while maintaining the dimension of the text feature image, thereby obtaining a text enhanced feature image.
8. The method according to claim 6, characterized in that The text recognition model also includes a second feature extraction network, which includes a second convolution module and at least two second receptive field enhancement modules; The step of identifying text in the target wiring diagram according to the text enhanced feature image to obtain at least one text comprises: The second convolution module is used to perform feature extraction on the text enhancement feature image, and the at least two second receptive field enhancement modules are used to perform receptive field enhancement based on the obtained feature extraction results to identify the text in the target wiring diagram and obtain at least one text.
9. The method according to claim 1, characterized in that: The matching of the at least one graphic element with the at least one text to obtain a matching result includes: Obtaining a text center position of each text in the at least one text; For each of the at least one graphic element, obtain a graphic element center position of the graphic element, and determine a distance between the graphic element center position and each obtained text center position; According to the distance, a text in the at least one text that matches the graphic element is determined to obtain a matching result.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the wiring diagram recognition method according to any one of claims 1 to 9 when executed.
Citation Information
Cited By
Robot service-oriented CAD drawing intelligent analysis method and device
CN119763142A
