Analog circuit component connection relationship extraction device
Through the analog circuit component connection relationship extraction device, using deep learning network model and data enhancement technology, the problem of low accuracy of component connection relationship extraction in the simulated integrated circuit in the prior art is solved, and fast and accurate connection relationship extraction is achieved.
Patent Information
- Application Number
- CN202311080732.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-08-25
AI Technical Summary
The accuracy of extracting component connection relationships from analog integrated circuits is low, and cannot meet the rapidly developing microelectronics technology needs.
The analog circuit component connection relationship extraction device is adopted, including a user input module, component detection module, backbone extraction module, port information processing module and connection relationship extraction module. The deep learning network model and data enhancement technology are used to judge the connection relationship between components through sampling points and similarity thresholds.
It realizes the rapid and accurate extraction of the connection relationship between components from the analog integrated circuit image, improves the extraction speed and accuracy, and enhances the detection capability of deep learning network models.
Smart Images

Figure CN117095424B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of analog integrated circuit automation and artificial intelligence technology, and in particular to a device for extracting connection relationships of analog circuit components. Background Art
[0002] In recent years, with the rapid advancement of semiconductor technology, the scale of integrated circuits (ICs) has grown exponentially, posing a challenge to the scalability of existing electronic design automation (EDA) algorithms and technologies. Without computer-aided design, analog IC design is typically performed manually, requiring repeated circuit modifications until the circuit meets design requirements and manual layout drawing. Given the rapid development of microelectronics technology, the efficiency of traditional design methods is no longer able to keep up with the industry's demand for rapid product design iterations.
[0003] Efforts to automate analog layout design can be traced back decades. ILAC (Interactive Layout of Analog CMOS Circuits) is one of the early achievements of analog EDA. Its layout generator consists of predefined templates for basic analog circuits. Its approach is process-oriented, storing pre-designed basic modules and establishing a standard library. This library can then be used during automated wiring layout to accelerate the design process. Fundamentally, current research in this field focuses on deriving analog layouts from circuit connectivity structures, or optimizing the layout of analog layouts to achieve optimal line lengths and area while taking into account various effects.
[0004] However, the connection relationship extracted from the circuit using the existing technology still has the problem of low accuracy. Summary of the Invention
[0005] The present invention is made to solve the above-mentioned problem, and its purpose is to provide a device for extracting the connection relationship of analog circuit components.
[0006] The present invention provides an analog circuit component connection relationship extraction device for extracting the connection relationship between components from an analog integrated circuit image, which has the following characteristics: a user input module for the user to input the analog integrated circuit image, a component detection module for extracting the component category and relative coordinate information of each component in the analog integrated circuit image; a backbone extraction module for preprocessing the analog integrated circuit image according to the relative coordinate information and component category to obtain a circuit backbone image; a port information processing module for extracting the ports of each component and the corresponding port coordinates according to the circuit backbone image, the relative coordinate information and the component category; a connection relationship extraction module for extracting the connection relationship between components from an analog integrated circuit image, a component detection module for extracting the connection relationship between components from an analog integrated circuit image, a component detection module for extracting the component category and the relative coordinate information of each component in the analog integrated circuit image; a connection relationship extraction ... The system extraction module is used to obtain a connection relationship based on the ports, port coordinates and the simulated integrated circuit image, wherein the process of obtaining the connection relationship in the connection relationship extraction module includes the following steps: step S1, all ports are combined in pairs to obtain a combination set containing multiple combinations; step S2, for each combination, judging whether the two ports in the combination are on the same straight line according to the port coordinates, if so, the line segment obtained by connecting the two ports is used as the predicted path, if not, a rectangle is constructed according to the port coordinates to obtain an upper inflection point path and a lower inflection point path as the predicted paths respectively; step S3, for components whose predicted component category is circuit node, according to the relative coordinates of the component The information is used to construct a small-range rectangle; step S4, for each predicted path, when the predicted path passes through the small-range rectangle, the combination constructed by the port of the circuit node corresponding to the small-range rectangle and the port in the combination corresponding to the predicted path is deleted from the combination set to obtain an optimized combination set; step S5, for the predicted path corresponding to each combination in the optimized combination set, k sampling points are selected from the predicted path, and the pixel values corresponding to each sampling point are obtained from the analog integrated circuit image, and then all the pixel values are added and normalized to obtain a normalized value; step S6, for each combination, it is determined whether the predicted path corresponding to the combination is a line segment. If so, the normalized value corresponding to the line segment is used as the corresponding value of the combination. similarity result, if not, select the smaller value of the normalized values corresponding to the upper inflection point path and the lower inflection point path as the similarity result of the combination; step S7, for each component, sort the similarity results of all combinations of ports containing the component that are greater than the similarity threshold from large to small, and then select the combinations corresponding to the first n similarity results as the connection combination according to the component category of the component; step S8, determine whether the predicted path corresponding to the similarity result of the connection combination passes through the small range rectangle, if so, connect the circuit node corresponding to the small range rectangle with the two components corresponding to the connection combination, if not, connect the two components corresponding to the connection combination to form a connection relationship.
[0007] The analog circuit component connection relationship extraction device provided by the present invention may also have the following features: wherein, the training process of the deep learning network model includes the following steps: step T1, using multiple existing circuit images as source images; step T2, annotating the components in the source image with the component type and the relative position of the components to obtain an annotation file; step T3, performing data enhancement on the source image and the corresponding annotation file according to the Channel-Mix algorithm to obtain a training image and a training annotation file as a training data set; step T4, constructing an initial deep learning network model; step T5, randomly selecting a training image from the training data set and inputting it into the initial deep learning network model to obtain the detection coordinates of the upper left corner and the lower right corner of the detection frame of the training image and the confidence of the detection result type; step T6, calculating the loss function according to the detection coordinates and the relative position of the components in the corresponding training annotation file, and optimizing the initial deep learning network model according to the calculation results; step T7, repeating steps T5 to T6 until the calculation results converge, and then using the optimized initial deep learning network model as the deep learning network model.
[0008] The analog circuit component connection relationship extraction device provided by the present invention may also have the following features: wherein, in step T3, the data enhancement process is specifically as follows: performing channel separation on the source image to obtain matrices of the three RGB color channels, performing image processing on the source image to obtain matrices of the grayscale image, Sobel operator, gradient map and feature image respectively, and then randomly extracting three matrices from all matrices corresponding to the source image to perform channel combination to obtain a combined image, using the combined image and the source image as a mixed image, reading the relative positions of the components of the small target in the annotation file, selecting m sub-images of the small target therefrom, and then randomly pasting multiple sub-images on each mixed image to obtain a training image, and adding the relative positions of the components and the component types of the sub-images to the corresponding annotation file to obtain a training annotation file.
[0009] The analog circuit component connection relationship extraction device provided by the present invention may also have the following characteristics: wherein, the loss function in step T6 is focal-loss, and by setting different weighting coefficients for different component types, the influence of component types with a smaller number of training samples in the training data set on the parameters of the initial deep learning network model is expanded during gradient descent.
[0010] The analog circuit component connection relationship extraction device provided by the present invention may also have the following features: wherein, the component detection module includes a deep learning network model and stores data of a confidence threshold. By inputting the analog integrated circuit image into the deep learning network model, the predicted component category, confidence and relative coordinate information of each component are obtained, and then the predicted component category corresponding to the confidence greater than the confidence threshold is used as the component category of the component.
[0011] The analog circuit component connection relationship extraction device provided by the present invention may also have the following features: wherein, the deep learning network model includes a Swin-Transformer module, a PAFPN network module and a detection head module, the Swin-Transformer module is used to extract features of the input analog integrated circuit image to obtain output features, the PAFPN network module is used to perform feature fusion on the output features to obtain fused features, and the detection head module is used to obtain relative coordinate information, predict component categories and corresponding confidence levels based on the fused features.
[0012] The analog circuit component connection relationship extraction device provided by the present invention may also have the following features: wherein, the backbone extraction module preprocesses the analog integrated circuit image as follows: constructing a rectangle based on relative coordinate information and filling the rectangle with color; performing Gaussian blur and multiple corrosion and dilation processing on the analog integrated circuit image; obtaining the largest connected domain in the analog integrated circuit image through a connected domain detection algorithm; and performing backbone extraction on the connected domain through a refinement algorithm to obtain a circuit backbone image.
[0013] The analog circuit component connection relationship extraction device provided by the present invention may also have the following features: wherein, in the process of extracting the port of the component by the port information processing module, when the component category of the component is a circuit node, the component is taken as a point and only one port and its corresponding port coordinates are extracted; when the component category of the component is power supply VCC, the component is appropriately displaced and then the port of the component and its corresponding port coordinates are extracted.
[0014] Functions and effects of the invention
[0015] The analog circuit component connection relationship extraction device of the present invention obtains normalized values through sampling points, thereby reflecting the similarity between the predicted path and the actual connection line, thereby more accurately obtaining the connection relationship between components. By setting a small range rectangle for circuit nodes and combining sampling points for path judgment, misjudgment of the connection relationship involving circuit nodes is avoided. A coarse screening is performed by setting a similarity threshold, and then a fine screening is performed according to similarity ranking and component category, thereby accelerating the extraction of connection relationships. Therefore, the analog circuit component connection relationship extraction device of the present invention can quickly and accurately extract the connection relationship between components from analog integrated circuit images. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 1 is a block diagram of a device for extracting connection relationships of analog circuit components according to an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of a simulated integrated circuit image in an embodiment of the present invention;
[0018] Figure 3 This is a schematic diagram of the effect of the deep learning network model output in an embodiment of the present invention;
[0019] Figure 4 Schematic diagram of the training process of the deep learning network model in an embodiment of the present invention;
[0020] Figure 5 is a schematic diagram of a circuit backbone image in an embodiment of the present invention;
[0021] Figure 6 is a schematic diagram showing the effect of simulating the position of ports in an integrated circuit image according to an embodiment of the present invention;
[0022] Figure 7 1 is a schematic diagram of a process for extracting connection relationships by a connection relationship extraction module in an embodiment of the present invention;
[0023] Figure 8 is a schematic diagram of a predicted path passing through a small rectangle in an embodiment of the present invention;
[0024] Figure 9 It is a schematic diagram of the connection relationship in the embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the technical means, creative features, objectives and effects of the present invention easy to understand, the following embodiments and the accompanying drawings specifically illustrate the analog circuit component connection relationship extraction device of the present invention.
[0026] Figure 1It is a structural block diagram of an apparatus for extracting connection relations of analog circuit components in an embodiment of the present invention.
[0027] like Figure 1 As shown, this embodiment provides an analog circuit component connection relationship extraction device 100 for extracting the connection relationship between components from an analog integrated circuit image, including a user input module 10, a component detection module 20, a backbone extraction module 30, a port information processing module 40 and a connection relationship extraction module 50.
[0028] The user input module 10 is used for the user to input the analog integrated circuit image.
[0029] Figure 2 is a schematic diagram of a simulated integrated circuit image in an embodiment of the present invention.
[0030] like Figure 2 As shown, the analog integrated circuit image includes a power supply vcc_1, namely V DD , current source current_source_1 (I1), resistor resistor_1 (R1), MOSFET n_mos_1 (M1), voltage source voltage_source_1 (V x , circuit node kernel_1, i.e., the node pointed by arrow 1, circuit node kernel_2, i.e., the node pointed by arrow 2, ground port gnd_1, i.e., the component pointed by arrow 3, and ground port gnd_2 and the component pointed by arrow 4.
[0031] The component detection module 20 includes a deep learning network model 200 and stores confidence threshold data, which is used to extract the component category and relative coordinate information of each component in the analog integrated circuit image. The specific process is as follows:
[0032] The simulated integrated circuit image is input into the deep learning network model to obtain the predicted component category, confidence and relative coordinate information of each component. The predicted component category corresponding to the confidence greater than the confidence threshold is then used as the component category of the component.
[0033] In this embodiment, the relative coordinate information is [x 1pre ,y 1pre ,x 2pre ,y 2pre ], x 1pre is the horizontal coordinate of the upper left corner of the identification box corresponding to the component, y 1pre is the vertical coordinate of the upper left corner of the identification box corresponding to the component, x 2pre is the horizontal coordinate of the lower right corner of the identification box corresponding to the component, y 2pre It is the vertical coordinate of the lower right corner of the identification box corresponding to the component.
[0034] Figure 3 Schematic diagram of the output effect of the component detection module in an embodiment of the present invention.
[0035] like Figure 3 As shown, the rectangular box surrounding each component is the identification box corresponding to each component. The coordinates of the upper left corner and the lower right corner of the identification box are the relative coordinate information of the component. Each rectangular box is marked with the component category and confidence level of the component detected by the component detection module 20. For example, for V DD The component category obtained through identification is vcc, and the corresponding confidence level is 97.9.
[0036] The deep learning network model 200 includes a Swin-Transformer module 201 , a PAFPN network module 202 and a detection head module 203 .
[0037] The Swin-Transformer module 201 is used to extract features from the input analog integrated circuit image to obtain output features. In this embodiment, the size of the output features is [192, 384, 768], which corresponds to the channel channel, width width, and height height respectively.
[0038] The PAFPN network module 202 is used to perform feature fusion on the output features to obtain fused features. The feature fusion combines deep content containing more semantic information and shallow image information, which can improve network recognition accuracy.
[0039] The detection head module 203 is used to obtain relative coordinate information, predict component categories and corresponding confidence levels based on fusion features. In this embodiment, the predicted component category is the corresponding category obtained based on the relative coordinate information and the confidence level.
[0040] In this embodiment, the deep learning network model 200 is also provided with a dilated convolution for expanding the receptive field of the detection network and improving the accuracy of small target detection results.
[0041] Figure 4 It is a schematic diagram of the training process of the deep learning network model in an embodiment of the present invention.
[0042] like Figure 4 As shown, the training process of the deep learning network model 200 includes the following steps:
[0043] In step T1, multiple existing circuit images are used as source images. In this embodiment, the circuit images are derived from analog integrated circuit books in PDF format, electronic scans of analog integrated circuit books, photographed images of analog integrated circuit books, photographed images and scans of hand-drawn analog integrated circuit schematics, etc.
[0044] Step T2: annotate the components in the source image with their component types and relative positions to obtain an annotation file.
[0045] In this embodiment, the components are labeled using the Labelme open source labeling tool. The relative positions of the components are the coordinates of the upper left corner (x1, y1) and the lower right corner (x2, y2) of the component. The component types include MOS tubes, power amplifiers, capacitors, resistors and other components, power ports, ground ports, output ports and other ports, as well as circuit nodes and other information.
[0046] In step T3, data enhancement is performed on the source image and the corresponding annotation file according to the Channel-Mix algorithm to obtain the training image and the training annotation file as the training data set.
[0047] The specific process of data enhancement is as follows:
[0048] The source image is channel-separated to obtain matrices of the three RGB color channels. The source image is processed to obtain matrices of the grayscale image, Sobel operator, gradient map, and feature image, respectively. Three matrices are randomly extracted from all matrices corresponding to the source image for channel combination to obtain a combined image. The combined image and the source image are used as a mixed image. The relative positions of the components of the small target in the annotation file are read, and m sub-images of the small target are selected therefrom. Multiple sub-images are randomly pasted into each mixed image to obtain a training image, and the relative positions and component types of the sub-images are added to the corresponding annotation file to obtain a training annotation file. In this embodiment, the component of the small target is the ground port gnd.
[0049] Step T4: construct an initial deep learning network model.
[0050] Step T5: randomly select a training image from the training data set and input it into the initial deep learning network model to obtain the detection coordinates of the upper left corner and lower right corner of the detection box of the training image and the confidence of the detection result type.
[0051] Step T6: Calculate the loss function based on the detection coordinates and the relative positions of the components in the corresponding training annotation file, and optimize the initial deep learning network model based on the calculation results.
[0052] Among them, the loss function is the focal-loss. By setting different weighting coefficients for different component types, the influence of component types with a smaller number of training samples in the training dataset on the parameters of the initial deep learning network model is expanded during gradient descent.
[0053] Step T7, repeat steps T5 to T6 until the calculation results converge, and then use the optimized initial deep learning network model as the deep learning network model.
[0054] The backbone extraction module 30 is used to pre-process the analog integrated circuit image according to the relative coordinate information and component categories to obtain the circuit backbone image. The specific process is as follows:
[0055] A rectangle is constructed based on relative coordinate information and filled with color. Gaussian blur and multiple corrosion and dilation processes are performed on the analog integrated circuit image. The largest connected domain in the analog integrated circuit image is obtained through a connected domain detection algorithm. The backbone of the connected domain is extracted through a thinning algorithm to obtain a circuit backbone image.
[0056] In this embodiment, the color of the rectangle filling is black to prevent errors caused by disconnected component shapes during connected domain detection. Together with Gaussian blur and erosion dilation as morphological processing operations, the circuit backbone image can be better extracted.
[0057] Figure 5 is a schematic diagram of a circuit backbone image in an embodiment of the present invention.
[0058] like Figure 5 As shown, the circuit backbone image is a grayscale image, the value of the connected area, i.e., the backbone, is 0, i.e., the backbone color is black, and the value of the non-connected area, i.e., the non-backbone part, is 255, i.e., the non-backbone color is white.
[0059] The port information processing module 40 is used to extract the ports of each component and the corresponding port coordinates according to the circuit backbone image, relative coordinate information and component category. The process of extracting the ports and port coordinates is as follows:
[0060] For each component, according to its relative coordinate information [x 1pre ,y 1pre ,x 2pre ,y 2pre ], for (x 1pre -1,y 1pre -1) and (x 2pre -1,y 2pre -1) is set to 255, that is, the interior of the rectangle is filled with white, so that only the outermost outline of one pixel unit is retained for the rectangle constructed with the relative coordinate information of the component, and then the pixel points whose values in the outline are not 255 are used as the ports of the component, that is, the black pixel points in the outermost outline are used as the ports of the component, and the corresponding pixel point coordinates are obtained as the port coordinates.
[0061] Among them, in the process of extracting the port of the component by the port information processing module 40, when the component category of the component is a circuit node, the component is taken as a point and only one port and its corresponding port coordinates are extracted; when the component category of the component is power supply vcc, the component is appropriately displaced and then the port of the component and its corresponding port coordinates are extracted.
[0062] Figure 6 It is a schematic diagram of the effect of simulating the port positions in the integrated circuit image in an embodiment of the present invention.
[0063] like Figure 6 As shown, the ports extracted from the circuit backbone image by the port information processing module 40 include vcc_1 endpoint, current_source_1 endpoint 1, current_source_1 endpoint 2, resistor_1 endpoint 1, resistor_1 endpoint 2, kernel_1 endpoint, kernel_2 endpoint, n_mos_1 endpoint 1, n_mos_1 endpoint 2, n_mos_1 endpoint 3, gnd_1 endpoint, gnd_2 endpoint, voltage_source_1 endpoint 1 and voltage_source_1 endpoint 2, and the specific port positions are the positions indicated by their respective arrows, and the coordinates of the positions are the port coordinates.
[0064] The connection relationship extraction module 50 is used to obtain the connection relationship according to the ports, port coordinates and the simulated integrated circuit image.
[0065] Figure 7 It is a schematic diagram of the process of extracting connection relations by the connection relation extraction module in an embodiment of the present invention.
[0066] like Figure 7 As shown, the process of obtaining the connection relationship by the connection relationship extraction module 50 according to the ports, port coordinates and the simulated integrated circuit image includes the following steps:
[0067] Step S1: All ports are combined in pairs to obtain a combination set containing multiple combinations.
[0068] Step S2: For each combination, determine whether the two ports in the combination are on the same straight line based on the port coordinates. If so, use the line segment connecting the two ports as the predicted path. If not, construct a rectangle based on the port coordinates to obtain the upper inflection point path and the lower inflection point path as the predicted paths respectively.
[0069] In this embodiment, the vertex at the upper left corner of the rectangle is taken as vertex A, and the remaining three vertices are marked as vertex B, vertex C and vertex D in sequence. The edge between vertex A and vertex B is recorded as edge AB, and the remaining edges are edge BC, edge CD and edge AD respectively. When vertex A and vertex C are two combined ports, edge AD and edge AB constitute the upper inflection point path, and edge BC and edge CD constitute the lower inflection point path.
[0070] Step S3 : for a component whose predicted component category is a circuit node, a small-range rectangle is constructed according to the relative coordinate information of the component. In this embodiment, the intersection of the diagonals of the small-range rectangle is the center of the circuit node.
[0071] Step S4: for each predicted path, when the predicted path passes through a small range rectangle, a combination constructed by the port of the circuit node corresponding to the small range rectangle and the port in the combination corresponding to the predicted path is deleted from the combination set to obtain an optimized combination set.
[0072] Figure 8 Schematic diagram of a predicted path passing through a small rectangle in an embodiment of the present invention.
[0073] like Figure 6 、 Figure 8 As shown, line segment AB is a predicted path generated by connecting the combination 1 consisting of the endpoint 2 of current_source_1 and the endpoint 2 of n_mos_1 by a straight line, endpoint A of line segment AB is the endpoint 2 of current_source_1, and endpoint B is the endpoint 2 of n_mos_1, line segment AC is a predicted path generated by connecting the combination 2 consisting of the endpoint of kernel_1 and the endpoint 2 of current_source_1 by a straight line, and line segment BC is a predicted path generated by connecting the combination 3 consisting of the endpoint of kernel_1 and the endpoint 2 of n_mos_1 by a straight line. The combination set contains the above three combinations, and combination 1 is preferentially selected from the combination set to determine whether the corresponding predicted path passes through the small-range rectangle. At this time, it is determined that the predicted path passes through the circuit node kernel_1 corresponding to the endpoint of kernel_1, that is, point C, to construct a small-range rectangle. Then, it is determined that the predicted path corresponding to combination 1 includes the predicted paths corresponding to combinations 2 and 3. Therefore, combination 2 and combination 3 are deleted from the combination set, thereby reducing unnecessary calculations.
[0074] In this embodiment, combinations formed between ports of components that are not circuit nodes are preferentially calculated. By detecting whether the predicted paths corresponding to these combinations pass through the small rectangular area corresponding to each circuit node, combinations formed between circuit nodes and ports of other components are deleted, and the predicted paths are no longer calculated for these combinations, thereby saving computing resources. If a combination formed between circuit nodes and ports of other components still exists in the optimized combination set after deletion, the predicted path is calculated for this combination in a subsequent step to confirm whether there is a connection relationship between the circuit node and the component.
[0075] Step S5: For the prediction path corresponding to each combination in the optimized combination set, k sampling points are selected from the prediction path, and the pixel values corresponding to each sampling point are obtained from the analog integrated circuit image. All pixel values are then added and normalized to obtain a normalized value.
[0076] In this embodiment, the components and connecting lines of the analog integrated circuit image are black pixels, that is, the pixel value is 0, and the remaining blank parts are white pixels, that is, the pixel value is 255. The normalized value can reflect the matching relationship between the predicted path and the connecting lines in the analog integrated circuit image. The smaller the normalized value, the greater the similarity between the predicted path and the connecting lines, and the larger the normalized value, the smaller the similarity between the predicted path and the connecting lines.
[0077] Step S6: For each combination, determine whether the predicted path corresponding to the combination is a line segment. If so, take the normalized value corresponding to the line segment as the similarity result of the combination. If not, select the smaller value of the normalized values corresponding to the upper inflection point path and the lower inflection point path as the similarity result of the combination.
[0078] Step S7: For each component, sort the similarity results of all combinations of ports containing the component that are greater than the similarity threshold from large to small, and then select the combinations corresponding to the first n similarity results as the connection combinations based on the component category of the component. In this embodiment, when the component category is a circuit node, the value of n is 3.
[0079] Step S8, determine whether the predicted path corresponding to the similarity result of the connection combination passes through the small-range rectangle. If so, the circuit node corresponding to the small-range rectangle is connected to the two components corresponding to the connection combination. That is, when the components corresponding to the connection combination are A and B and the circuit node is C, the connection relationships are A and C and B and C. If not, the two components corresponding to the connection combination are connected.
[0080] Figure 9 It is a schematic diagram of the connection relationship in the embodiment of the present invention.
[0081] like Figure 9As shown, the connection relationship extracted by the connection relationship extraction module 50 is {('resistor_1','kernel_2'),('resistor_1','kernel_1'),('n_mos_1','kernel_2'),('n_mos_1','gnd_2'),('n_mos_1','kernel_1'),('current_source_1','kernel_1'),('current_source_1','vcc_1'),('voltage_source_1','kernel_2'),('volta ge_source_1','gnd_1')}, that is, the resistor resistor_1 is connected to the circuit nodes kernel_1 and kernel_2 respectively, the MOSFET n_mos_1 is connected to the ground port gnd_2 and the circuit nodes kernel_1 and kernel_2 respectively, the current source current_source_1 is connected to the power supply vcc_1 and the circuit node kernel_1 respectively, and the voltage source voltage_source_1 is connected to the ground port gnd_1 and the circuit node kernel_2 respectively.
[0082] The above connection relationship is Figure 1 The actual connection relationship of each component in the image is consistent. It can be seen that the analog circuit component connection relationship extraction device 100 of this embodiment can quickly extract the connection relationship between components in the analog integrated circuit image with a high accuracy.
[0083] Functions and Effects of the Embodiments
[0084] According to the analog circuit component connection relationship extraction device involved in this embodiment, a normalized value is obtained through sampling points, which further reflects the similarity between the predicted path and the actual connection line, thereby being able to more accurately obtain the connection relationship between components. By setting a small range rectangle for the circuit node and combining the sampling points for path judgment, misjudgment of the connection relationship involving the circuit node is avoided. By setting a similarity threshold for coarse screening and then fine screening according to similarity ranking and component category, the speed of connection relationship extraction is accelerated.
[0085] By using the Channel-Mix algorithm to enhance a small amount of existing data, we can obtain more training data while enhancing the deep learning network model's ability to detect and label components, and further improve the robustness of the analog circuit component connection relationship extraction device.
[0086] The circuit nodes and the power supply Vcc are adaptively adjusted in the port information processing module, thereby improving the accuracy of the connection relationship including the circuit nodes or the power supply Vcc output by the connection relationship extraction module.
[0087] In summary, this method can quickly and accurately extract the connection relationship between components from analog integrated circuit images.
[0088] The above embodiments are preferred examples of the present invention and are not intended to limit the scope of protection of the present invention.
Claims
1. A device for extracting connection relationships between analog circuit components, used to extract connection relationships between components from an analog integrated circuit image, characterized in that: include: A user input module is used for the user to input the analog integrated circuit image. A component detection module, configured to extract component category and relative coordinate information of each component in the analog integrated circuit image; A backbone extraction module, configured to extract the backbone of the analog integrated circuit image according to the relative coordinate information and the component category to obtain a circuit backbone image; A port information processing module, configured to extract the ports of each component and the corresponding port coordinates according to the circuit backbone image, the relative coordinate information and the component category; A connection relationship extraction module is used to obtain the connection relationship according to the port, the port coordinates and the analog integrated circuit image, Wherein, in the connection relationship extraction module, the process of obtaining the connection relationship includes the following steps: Step S1, combining all the ports in pairs to obtain a combination set containing multiple combinations; Step S2: for each combination, determining whether the two ports in the combination are on the same straight line based on the port coordinates; if so, taking the line segment connecting the two ports as the predicted path; if not, constructing a rectangle based on the port coordinates to obtain an upper inflection point path and a lower inflection point path as the predicted paths, respectively; Step S3, for the component whose predicted component category is a circuit node, constructing a small-range rectangle according to the relative coordinate information of the component; Step S4, for each predicted path, when the predicted path passes through the small range rectangle, deleting a combination formed by a port of the circuit node corresponding to the small range rectangle and a port in the combination corresponding to the predicted path from the combination set, to obtain an optimized combination set; Step S5, for the prediction path corresponding to each combination in the optimized combination set, select k sampling points from the prediction path, obtain pixel values corresponding to each sampling point from the analog integrated circuit image, and then add and normalize all the pixel values to obtain a normalized value; Step S6: for each combination, determining whether the predicted path corresponding to the combination is the line segment; if so, taking the normalized value corresponding to the line segment as the similarity result of the combination; if not, selecting the smaller value of the normalized values corresponding to the upper inflection point path and the lower inflection point path as the similarity result of the combination; Step S7: for each component, sort the similarity results of all combinations of the ports of the component that are greater than a similarity threshold from largest to smallest, and then select the combinations corresponding to the first n similarity results as the connection combinations based on the component category of the component; Step S8, determining whether the predicted path corresponding to the similarity result of the connection combination passes through the small-range rectangle; if so, forming the connection relationship between the circuit node corresponding to the small-range rectangle and the two components corresponding to the connection combination; if not, forming the connection relationship between the two components corresponding to the connection combination.
2. The device for extracting connection relationships of analog circuit components according to claim 1, wherein: in, The component detection module includes a deep learning network model and stores data with confidence thresholds. By inputting the simulated integrated circuit image into the deep learning network model, the predicted component category, confidence and relative coordinate information of each component are obtained, and then the predicted component category corresponding to the confidence greater than the confidence threshold is used as the component category of the component.
3. The analog circuit component connection relationship extraction device according to claim 2, Its characteristics are: in, The training process of the deep learning network model includes the following steps: Step T1, using multiple existing circuit images as source images; Step T2, marking the components in the source image with component types and relative positions to obtain a marking file; Step T3, performing data enhancement on the source image and the corresponding annotation file according to the Channel-Mix algorithm to obtain a training image and a training annotation file as a training data set; Step T4, constructing an initial deep learning network model; Step T5: randomly selecting the training image from the training data set and inputting it into the initial deep learning network model to obtain the detection coordinates of the upper left corner and the lower right corner of the detection box of the training image and the confidence of the detection result type; Step T6, calculating a loss function based on the detection coordinates and the relative positions of components in the corresponding training annotation file, and optimizing the initial deep learning network model based on the calculation results; Step T7, repeating steps T5 to T6 until the calculation results converge, and then using the optimized initial deep learning network model as the deep learning network model.
4. The device for extracting connection relationships of analog circuit components according to claim 3, wherein: in, The data enhancement process in step T3 is specifically as follows: The source image is channel-separated to obtain matrices of the three RGB color channels, and the source image is processed to obtain matrices of the grayscale image, the Sobel operator, the gradient map, and the feature image, respectively. Three matrices are randomly selected from all matrices corresponding to the source image for channel combination to obtain a combined image, and the combined image and the source image are used as the mixed image. The relative positions of the components of the small target in the annotation file are read, m sub-images of the small target are selected therefrom, and then a plurality of the sub-images are randomly pasted into each mixed image to obtain the training image, and the relative positions of the components and the component types of the sub-images are added to the corresponding annotation file to obtain the training annotation file.
5. The analog circuit component connection relationship extraction device according to claim 3, characterized in that: in, The loss function in step T6 is focal-loss, which sets different weighting coefficients for different component types, thereby expanding the influence of the component types with a smaller number of training samples in the training data set on the parameters of the initial deep learning network model during gradient descent.
6. The analog circuit component connection relationship extraction device according to claim 2, characterized in that: in, The deep learning network model includes a Swin-Transformer module, a PAFPN network module and a detection head module. The Swin-Transformer module is used to extract features from the input analog integrated circuit image to obtain output features. The PAFPN network module is used to perform feature fusion on the output features to obtain fused features. The detection head module is used to obtain the relative coordinate information, the predicted component category and the corresponding confidence level according to the fusion feature.
7. The analog circuit component connection relationship extraction device according to claim 1, characterized in that: in, The process of preprocessing the analog integrated circuit image by the backbone extraction module is as follows: Constructing a rectangle according to the relative coordinate information and filling the rectangle with color; Performing Gaussian blur and multiple erosion and dilation processes on the analog integrated circuit image; Obtaining the largest connected domain in the analog integrated circuit image by a connected domain detection algorithm; The backbone of the connected domain is extracted by a thinning algorithm to obtain the circuit backbone image.
8. The analog circuit component connection relationship extraction device according to claim 1, characterized in that: in, In the process of extracting the port of the component by the port information processing module, when the component category of the component is the circuit node, the component is taken as a point to extract only one port and its corresponding port coordinates. When the component type of the component is power supply vcc, the component is appropriately displaced and then the port of the component and the corresponding port coordinates are extracted.
Citation Information
Patent Citations
Physical circuit diagram recognition method based on deep learning and application thereof
CN112528845A
Circuit component identification method and device and computer equipment
CN115187829A