Terminal strip circuit diagram intelligent identification method
Through multimodal large models and image processing algorithms, the problems of model generalization and environmental adaptability in terminal block circuit diagram recognition are solved, stable recognition and efficient extraction of terminal block graphic element information in complex environments are achieved, and the recognition accuracy and completeness of circuit diagrams are improved.
Patent Information
- Application Number
- CN202510706962.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-26
AI Technical Summary
The existing technology has poor model generalization ability and environmental adaptability in terminal block circuit diagram recognition, and lacks effective use of layout information and table information, resulting in insufficient recognition accuracy and completeness.
A large multimodal model is used in combination with a layout recognition model and a table recognition model. Gaussian filtering, median filtering and other algorithms are used to remove noise. Canny edge detection and HSV color space segmentation are used to identify the table area. OCR technology is combined to extract text information. Harris corner detection is used to locate cable corners and establish connection relationships.
It improves the recognition stability and accuracy of terminal block circuit diagrams, enhances the generalization ability of the model, and can stably identify terminal block elements in complex environments, completely extract table information and connection relationships, and improves recognition efficiency and the completeness of circuit diagram understanding.
Smart Images

Figure CN120708244A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method for intelligently identifying a terminal block circuit diagram. Background Art
[0002] In the field of electrical engineering, the accuracy and efficiency of terminal block circuit diagram recognition are crucial for the installation, commissioning, maintenance and automated operation of electrical equipment. With the development of artificial intelligence technology, especially the widespread application of deep learning, deep learning-based methods have gradually become an important technical means in the field of circuit diagram recognition.
[0003] Traditional circuit diagram recognition methods mainly rely on manually designed feature extraction algorithms, which are difficult to adapt to complex circuit diagram images and changes in various practical application scenarios, and have obvious deficiencies in recognition accuracy and robustness.
[0004] In recent years, deep learning models, especially convolutional neural networks (CNNs), have been able to automatically learn image features through large-scale data training, bringing new breakthroughs in circuit diagram recognition technology. However, existing technologies still have the following drawbacks when recognizing circuit diagrams, especially terminal block circuit diagrams: Poor model generalization: Existing models are primarily based on specific circuit diagram sample images and standard component images. When faced with circuit diagrams from different sources, styles, or quality, recognition accuracy drops significantly, and generalization is limited. Poor environmental adaptability: When circuit diagram images are captured in complex environments, such as those with noise interference, uneven lighting, and tilted angles, existing technologies are unable to effectively address these interference factors and accurately extract image features and identify components. 3. Lack of effective use of layout information and table information: Current technologies often ignore the structured extraction of circuit diagram version layout and table information. They may not be able to accurately identify the text, data and table structure in the table, resulting in the loss or incorrect parsing of table information, which in turn affects the accurate identification and understanding of related components in the circuit diagram, reducing the integrity and accuracy of circuit diagram recognition. Summary of the Invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an intelligent identification method for terminal block circuit diagrams.
[0006] To achieve the above object, the present invention adopts the following technical solutions: A method for intelligently identifying a terminal block circuit diagram comprises the following steps: S1: Read the terminal block circuit diagram image; Using Python image processing libraries such as OpenCV and Pillow, terminal block circuit diagram images of different sources, styles, and qualities to be processed are read and input into the terminal block circuit diagram intelligent recognition system. The terminal block circuit diagram intelligent recognition system includes a layout recognition model, a table recognition model, a multi-modal large model, etc.
[0007] S2: Layout recognition model processes the terminal block circuit diagram image; Perform layout analysis on the terminal block circuit diagram image, identify and extract the table image data, and filter non-business information. This includes the following sub-steps: S21: Obtain a table image in the terminal block circuit diagram image; Use Gaussian filtering, median filtering and other algorithms to pre-process the terminal block circuit diagram image to remove noise in the image and improve the accuracy of edge detection; The pre-processed terminal block circuit diagram image is subjected to layout analysis. The layout recognition model uses an image processing algorithm to identify the table area in the terminal block circuit diagram image and extracts the corresponding table image through an image segmentation algorithm. The image recognition algorithm includes edge detection, contour extraction algorithm, etc.
[0008] S22: filtering non-business information in the terminal block circuit diagram image; The following sub-steps are included: S221: training layout recognition model; Collect a large number of circuit diagram image data sets in advance, wherein the circuit diagram image data sets contain common business information and non-business information. The business information includes specific original parts, terminals, connecting lines, etc., and the non-business information includes background, annotations, text descriptions, etc. Use the collected business information and non-business information to train the layout recognition model. After the training is completed, the layout recognition model can effectively identify business information and non-business information; S222: Filter non-business information using a layout recognition model; The layout recognition model detects and locates non-business information in the terminal strip circuit diagram image, deletes the non-business information from the terminal strip circuit diagram image, and retains the terminal strip circuit diagram image containing business information related to the terminal strip and cables.
[0009] S3: parallel recognition processing; The following sub-steps are included: S31: Recognize table image information; Use the Canny edge detection algorithm to identify the row and column dividing lines in the table image obtained in step S21; The boundaries of each cell in the table image are delineated according to the row and column dividing lines. Each cell is a rectangular area formed by the intersection of two vertical lines and two horizontal lines. Optical character recognition (OCR) technology is used to extract the text content in each cell, and the relevant parameters and identification information of the terminal strip are extracted therefrom to obtain table image information; the relevant parameters include current, voltage, connection method, material information, physical size, etc., and the identification information is the number, model, specification, brand, etc. of each terminal contained in the terminal strip.
[0010] S32: Identify the vertex coordinates of the shorting piece; Identify short-circuit chips in table images through feature extraction and multi-model analysis; The shorting piece corresponds to a specific color and a regular geometric shape; Specifically, a color feature extraction algorithm such as HSV color space segmentation is used to extract an area containing a specific color from the table image obtained in step S21; Extracting a region of a specific regular shape from the table image obtained in step S21 using an edge detection algorithm such as Canny; The extracted regions containing specific colors and specific regular shapes are fused to obtain the region that satisfies both color and shape conditions, which is the short-circuit region; The coordinates of the shorting piece are obtained by the contour analysis algorithm; Specifically, the shorting link area includes a horizontal / vertical shorting link area and an inclined shorting link area; For the horizontal / vertical shorting patch area, the vertex coordinates, width, and height corresponding to its minimum bounding rectangle are obtained through the cv2.boundingRect function; the coordinates function obtains the four vertex coordinates of the bounding rectangle based on the vertex coordinates, width, and height, which are the four vertex coordinates of the shorting patch area; For the inclined shorting piece area, the center coordinates, width, and height of its minimum circumscribed rotated rectangle are calculated by the cv2.minAreaRect function; the RotatedRect function obtains the four vertex coordinates of the minimum circumscribed rotated rectangle based on the center coordinates, width, and height, which are the four vertex coordinates of the shorting piece area.
[0011] S33: Identify cable corners; Detecting and locating the corners of the cable from the terminal block circuit diagram image obtained in step S22 using a corner detection algorithm such as Harris corner detection or the Shi-Tomasi method to obtain corner coordinates; Connect the detected corners to obtain the connection relationship of the cables; S34: Comprehensively identify other graphics elements; The graphic elements include electrical component symbols, text annotations, etc. The deep learning model is trained in advance using common electrical component symbols in circuit diagrams so that the deep learning model can recognize electrical component symbols; the trained deep learning model is used to recognize the electrical component symbols and specific locations from the terminal block circuit diagram image obtained in step S22; Using a text area positioning algorithm, the area containing text annotations in the terminal block circuit diagram image is determined, and optical character recognition (OCR) technology is used to identify and extract specific information of the text annotations contained in the area, including terminal numbers, positions, etc. S4: Construct connection relationship information; The connection relationship information includes terminal block modeling information and connection information, and cable and terminal connection information; Based on the identified table image information, the vertex coordinates of the shorting piece, etc., the modeling information and connection information of the terminal block are generated by 3D software such as CAD; the modeling information and connection information of the terminal block include the shape of the terminal block, the terminal models included, the connection method of the terminals, the terminal positions, etc.; By analyzing the positional relationship between the cable corners and other graphic elements, the relevant parameters and identification information of the terminal block, the connection information between the cable and the terminal is constructed; the connection information includes the connection method, connection direction, connection position, etc. The modeling information of the terminal block is constructed according to the recognized table image information and the vertex coordinates of the short-circuit pieces. The modeling information of the terminal block includes the structure, parameters, and connection relationship of the terminal block.
[0012] S5: Integrate and construct structured data; The terminal block modeling information and connection information, and the cable and terminal connection information constructed in step S4 are integrated to form structured data of the terminal block modeling information, connection information, and cable relationship.
[0013] Compared with the prior art, the present invention has the following beneficial effects: By integrating a large multimodal model, this method can efficiently process multimodal information such as images, text, and tables, and deeply understand the semantic associations of graphic elements. This allows for stable recognition of terminal strip graphic elements in different scenarios, image quality, and layouts, improving the model's generalization capabilities and enabling it to adapt to a variety of practical application scenarios. Through staged anti-interference processing, recognition stability is enhanced in complex environments. Algorithms such as Gaussian filtering and median filtering are used to remove image noise, improving the impact of uneven lighting and angle tilt on edge detection and feature extraction. Combining HSV color space segmentation (color features) and Canny edge detection (shape features), the shorting patch area is located by fusing color and geometric shape, effectively addressing the challenge of target recognition in complex backgrounds. Harris or Shi-Tomasi corner detection algorithms are used to accurately locate cable corners, and cable connection relationships are constructed by connecting corners, reducing connection misjudgments caused by image distortion. Canny edge detection is used to identify table row and column dividing lines, accurately delineating cell boundaries. Combined with OCR technology, terminal block parameters (such as current, voltage, and model) and identification information (terminal number and specification) are extracted, avoiding information loss caused by traditional methods that ignore table structure. By parallelly identifying table images, short-circuit coordinates, cable corners, and other graphic elements (such as electrical symbols and text annotations), multi-level extraction of layout information is achieved, improving recognition efficiency while ensuring the integrity of the semantic understanding of the circuit diagram. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 The present invention is a flowchart of the steps of a method for intelligently identifying a terminal block circuit diagram. DETAILED DESCRIPTION
[0015] In order to provide a further understanding of the purpose, structure, features, and functions of the present invention, the present invention is described in detail below with reference to the embodiments.
[0016] like Figure 1 As shown, a terminal block circuit diagram intelligent recognition method includes the following steps: S1: Read the terminal block circuit diagram image; Read the terminal block circuit diagram image to be processed through Python image processing libraries such as OpenCV and Pillow, and input the image into the terminal block circuit diagram intelligent recognition system; The terminal block circuit diagram intelligent recognition system includes a layout recognition model, a table recognition model, a multi-modal large model, etc.
[0017] S2: Layout recognition model processes the terminal block circuit diagram image; Perform layout analysis on the terminal block circuit diagram image, identify and extract the table image data, and filter non-business information. This includes the following sub-steps: S21: Obtain a table image in the terminal block circuit diagram image; Use Gaussian filtering, median filtering and other algorithms to pre-process the terminal block circuit diagram image to remove noise in the image and improve the accuracy of edge detection; The pre-processed terminal block circuit diagram image is subjected to layout analysis. The layout recognition model uses an image processing algorithm to identify the table area in the terminal block circuit diagram image and extracts the corresponding table image through an image segmentation algorithm. The image recognition algorithm includes edge detection, contour extraction algorithm, etc.
[0018] S22: filtering non-business information in the terminal block circuit diagram image; The following sub-steps are included: S221: training layout recognition model; Collect a large number of circuit diagram image data sets in advance, wherein the circuit diagram image data sets contain common business information and non-business information. The business information includes specific original parts, terminals, connecting lines, etc., and the non-business information includes background, annotations, text descriptions, etc. Use the collected business information and non-business information to train the layout recognition model. After the training is completed, the layout recognition model can effectively identify business information and non-business information; S222: Filter non-business information using a layout recognition model; The layout recognition model detects and locates non-business information in the terminal strip circuit diagram image, deletes the non-business information from the terminal strip circuit diagram image, and retains the terminal strip circuit diagram image containing business information related to the terminal strip and cables.
[0019] S3: parallel recognition processing; The following sub-steps are included: S31: Recognize table image information; Use the Canny edge detection algorithm to identify the row and column dividing lines in the table image obtained in step S21; The boundaries of each cell in the table image are delineated according to the row and column dividing lines. Each cell is a rectangular area formed by the intersection of two vertical lines and two horizontal lines. Optical character recognition (OCR) technology is used to extract the text content in each cell, and the relevant parameters and identification information of the terminal strip are extracted therefrom to obtain table image information; the relevant parameters include current, voltage, connection method, material information, physical size, etc., and the identification information is the number, model, specification, brand, etc. of each terminal contained in the terminal strip.
[0020] S32: Identify the vertex coordinates of the shorting piece; Identify short-circuit chips in table images through feature extraction and multi-model analysis; The shorting piece corresponds to a specific color and a regular geometric shape; Specifically, a color feature extraction algorithm such as HSV color space segmentation is used to extract an area containing a specific color from the table image obtained in step S21; Extracting a region of a specific regular shape from the table image obtained in step S21 using an edge detection algorithm such as Canny; The extracted regions containing specific colors and specific regular shapes are fused to obtain the region that satisfies both color and shape conditions, which is the short-circuit region; The coordinates of the shorting piece are obtained by using the contour analysis algorithm; Specifically, the shorting link area includes a horizontal / vertical shorting link area and an inclined shorting link area; For the horizontal / vertical shorting patch area, the vertex coordinates, width, and height corresponding to its minimum bounding rectangle are obtained through the cv2.boundingRect function; the coordinates function obtains the four vertex coordinates of the bounding rectangle based on the vertex coordinates, width, and height, which are the four vertex coordinates of the shorting patch area; For the inclined shorting piece area, the center coordinates, width, and height of its minimum circumscribed rotated rectangle are calculated by the cv2.minAreaRect function; the RotatedRect function obtains the four vertex coordinates of the minimum circumscribed rotated rectangle based on the center coordinates, width, and height, which are the four vertex coordinates of the shorting piece area.
[0021] S33: Identify cable corners; Detecting and locating the corners of the cable from the terminal block circuit diagram image obtained in step S22 using a corner detection algorithm such as Harris corner detection or the Shi-Tomasi method to obtain corner coordinates; Connect the detected corners to obtain the connection relationship of the cables; S34: Comprehensively identify other graphics elements; The graphic elements include electrical component symbols, text annotations, etc. The deep learning model is trained in advance using common electrical component symbols in circuit diagrams so that the deep learning model can recognize electrical component symbols; the trained deep learning model is used to recognize the electrical component symbols and specific locations from the terminal block circuit diagram image obtained in step S22; Using a text area positioning algorithm, the area containing text annotations in the terminal block circuit diagram image is determined, and optical character recognition (OCR) technology is used to identify and extract specific information of the text annotations contained in the area, including terminal numbers, positions, etc. S4: Construct connection relationship information; The connection relationship information includes terminal block modeling information and connection information, and cable and terminal connection information; Based on the identified table image information, the vertex coordinates of the shorting piece, etc., the modeling information and connection information of the terminal block are generated by 3D software such as CAD; the modeling information and connection information of the terminal block include the shape of the terminal block, the terminal models included, the connection method of the terminals, the terminal positions, etc.; By analyzing the positional relationship between the cable corners and other graphic elements, the relevant parameters and identification information of the terminal block, the connection information between the cable and the terminal is constructed; the connection information includes the connection method, connection direction, connection position, etc. The modeling information of the terminal block is constructed according to the recognized table image information and the vertex coordinates of the short-circuit pieces. The modeling information of the terminal block includes the structure, parameters, and connection relationship of the terminal block.
[0022] S5: Integrate and construct structured data; The terminal block modeling information and connection information, and the cable and terminal connection information constructed in step S4 are integrated to form structured data of the terminal block modeling information, connection information, and cable relationship.
[0023] The method proposed in the present invention significantly enhances the layout recognition capability of terminal strip circuit diagrams. By optimizing the layout model and fine-tuning it, it can gain a deep insight into the layout of the terminal strip circuit diagram, accurately identify the location and type of each area, improve recognition efficiency, and lay the foundation for subsequent accurate analysis of the circuit diagram. Significantly improve the recognition accuracy of terminal strip tables. By introducing a table model and fine-tuning the data set based on the characteristics of terminal strip elements, the system fully exploits table features, overcomes the difficulty of complex table recognition, and achieves high-precision recognition and extraction of text, data, and structure in tables, while fully preserving table information. The generalization performance of terminal strip element recognition has been optimized. By integrating a large multimodal model, the model can efficiently process multimodal information such as images, text, and tables, and deeply understand the semantic associations of elements. This allows for stable recognition of terminal strip elements in different scenarios, image quality, and layouts, with excellent generalization performance. Improve the business structured modeling of terminal block connection relationships, use the model to analyze the connection relationships of terminal blocks, and build a business structured model to comprehensively and accurately present the connection details of terminal blocks, providing strong support for electrical system design and maintenance, and improving work efficiency and quality.
[0024] The present invention has been described with reference to the above embodiments. However, the above embodiments are merely exemplary embodiments of the present invention. It should be noted that the disclosed embodiments do not limit the scope of the present invention. On the contrary, modifications and improvements that do not depart from the spirit and scope of the present invention are intended to be protected by the present invention.
Claims
1. A method for intelligently identifying a terminal block circuit diagram, characterized in that: The following steps are involved: S1: Read the terminal block circuit diagram image; Reading terminal block circuit diagram images of different sources, styles and qualities to be processed, and inputting the images into a terminal block circuit diagram intelligent recognition system; The terminal block circuit diagram intelligent recognition system includes a layout recognition model, a table recognition model, and a multi-modal large model; S2: Layout recognition model processes the terminal block circuit diagram image; Perform layout analysis on the terminal block circuit diagram image, identify and extract the table image data, and filter non-business information. This includes the following sub-steps: S21: Obtain a table image in the terminal block circuit diagram image; S22: filtering non-business information in the terminal block circuit diagram image; The following sub-steps are included: S221: training layout recognition model; S222: Filter non-business information using a layout recognition model; S3: parallel recognition processing; The following sub-steps are included: S31: Recognize table image information; S32: Identify the vertex coordinates of the shorting piece; S33: Identify cable corners; S34: Comprehensively identify other graphics elements; S4: Construct connection relationship information; S5: Integrate and construct structured data; The terminal block modeling information and connection information, and the cable and terminal connection information constructed in step S4 are integrated to form structured data of the terminal block modeling information, connection information, and cable relationship.
2. The terminal block circuit diagram intelligent recognition method according to claim 1, characterized in that: The specific contents of step S2 are as follows: S21: Obtain a table image in the terminal block circuit diagram image; Use Gaussian filtering, median filtering and other algorithms to pre-process the terminal block circuit diagram image to remove noise in the image; The pre-processed terminal block circuit diagram image is subjected to layout analysis. The layout recognition model uses an image processing algorithm to identify the table area in the terminal block circuit diagram image and extracts the corresponding table image through an image segmentation algorithm. S22: filtering non-business information in the terminal block circuit diagram image; The following sub-steps are included: S221: training layout recognition model; Collecting a large number of circuit diagram image datasets in advance, wherein the circuit diagram image datasets contain common business information and non-business information; Use the collected business information and non-business information to train the layout recognition model. After the training is completed, the layout recognition model can effectively identify business information and non-business information; S222: Filter non-business information using a layout recognition model; The layout recognition model detects and locates non-business information in the terminal strip circuit diagram image, deletes the non-business information from the terminal strip circuit diagram image, and retains the terminal strip circuit diagram image containing business information related to the terminal strip and cables.
3. The terminal block circuit diagram intelligent recognition method according to claim 1, characterized in that: The specific contents of step S3 are as follows: S31: Recognize table image information; Use the Canny edge detection algorithm to identify the row and column dividing lines in the table image obtained in step S21; The boundaries of each cell in the table image are delineated according to the row and column dividing lines. Each cell is a rectangular area formed by the intersection of two vertical lines and two horizontal lines. Use optical character recognition (OCR) technology to extract the text content in each cell, and extract the relevant parameters and identification information of the terminal strip from it to obtain table image information; S32: Identify the vertex coordinates of the shorting piece; Identify short-circuit chips in table images through feature extraction and multi-model analysis; The shorting piece corresponds to a specific color and a regular geometric shape; Extract the areas containing specific colors and specific regular shapes and merge them to obtain the areas that meet both color and shape conditions, which are the short-circuit areas; The coordinates of the shorting piece are obtained by the contour analysis algorithm; S33: Identify cable corners; Using a corner detection algorithm, the corners of the cables are detected and located from the terminal block circuit diagram image obtained in step S22 to obtain corner coordinates; Connect the detected corners to obtain the connection relationship of the cables; S34: Comprehensively identify other graphics elements; The deep learning model is trained in advance using common electrical component symbols in circuit diagrams so that the deep learning model can recognize electrical component symbols; the trained deep learning model is used to recognize the electrical component symbols and specific locations from the terminal block circuit diagram image obtained in step S22; The text area positioning algorithm is used to determine the area containing text annotations in the terminal block circuit diagram image, and optical character recognition (OCR) technology is used to identify and extract specific information of the text annotations contained in the area.
4. The terminal block circuit diagram intelligent recognition method according to claim 1, wherein: The specific contents of step S4 are as follows: The connection relationship information includes terminal block modeling information and connection information, and cable and terminal connection information; Based on the identified table image information and the vertex coordinates of the shorting piece, the modeling information and connection information of the terminal strip are generated; by analyzing the positional relationship between the cable corners and other graphic elements, the relevant parameters and identification information of the terminal strip, the connection information between the cable and the terminal is constructed; based on the identified table image information and the vertex coordinates of the shorting piece, the modeling information of the terminal strip is constructed.
5. The terminal block circuit diagram intelligent recognition method according to claim 3, characterized in that: In step S32, the shorting link area includes a horizontal / vertical shorting link area and an inclined shorting link area; For the horizontal / vertical short-circuit area, use the cv2.boundingRect function to get the vertex coordinates, width, and height of its minimum bounding rectangle. The coordinates function obtains the coordinates of the four vertices of the circumscribed rectangle according to the vertex coordinates, width and height, which are the coordinates of the four vertices of the short-circuit area; For the inclined shorting piece area, the center coordinates, width, and height of its minimum circumscribed rotated rectangle are calculated by the cv2.minAreaRect function; the RotatedRect function obtains the four vertex coordinates of the minimum circumscribed rotated rectangle based on the center coordinates, width, and height, which are the four vertex coordinates of the shorting piece area.
Citation Information
Patent Citations
A method for identify connection relationship of flowchart
CN109389050A
A machine vision detection algorithm for logic circuit diagram information extraction
CN109508676A
Switch cabinet terminal diagram automatic identification method suitable for non-table primitives
CN115272172A
Method for identifying topological relation of main wiring diagram of power grid plant station
CN115457591A
Identification method and device for terminal block drawing short connecting piece primitives and storage medium
CN115995086A