0% found this document useful (0 votes)
77 views4 pages

From Image To Simulation An ANN-based Automatic Circuit Netlist Generator Img2Sim

The document presents Img2Sim, an Artificial Neural Network (ANN) based tool that automatically generates a simulation-ready netlist from an image of an electronic circuit with high accuracy. It classifies circuit elements with at least 98% accuracy and determines circuit topology and connections with over 90% accuracy, making it a significant advancement in electronic design automation. This tool is unique as it is the first to create an entire netlist from circuit images, addressing challenges in the traditional manual netlist generation process.

Uploaded by

afeng616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views4 pages

From Image To Simulation An ANN-based Automatic Circuit Netlist Generator Img2Sim

The document presents Img2Sim, an Artificial Neural Network (ANN) based tool that automatically generates a simulation-ready netlist from an image of an electronic circuit with high accuracy. It classifies circuit elements with at least 98% accuracy and determines circuit topology and connections with over 90% accuracy, making it a significant advancement in electronic design automation. This tool is unique as it is the first to create an entire netlist from circuit images, addressing challenges in the traditional manual netlist generation process.

Uploaded by

afeng616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2022 18th International Conference on Synthesis, Modeling, Analysis and Simulation Methods and Applications to Circuit Design (SMACD)

| 978-1-6654-6703-2/22/$31.00 ©2022 IEEE | DOI: 10.1109/SMACD55068.2022.9816254

From Image to Simulation: An ANN-based


Automatic Circuit Netlist Generator (Img2Sim)
Ahmet Emre Sertdemir∗ , Mehmet Besenk∗ , Tugba Dalyan∗ , Y. Daghan Gokdel† , and Engin Afacan‡
∗ Department of Computer Engineering, Istanbul Bilgi University
† Department of Electrical and Electronics Engineering, Istanbul Bilgi University
‡ Department of Electronics Engineering Gebze Technical University

Abstract—This study proposes an Artificial Neural Network netlist for a given circuit schematic in image format. To
(ANN) based netlist generator: Img2Sim. The tool acquires an this end, we proposes a novel CAD tool, Img2Sim, which
image of an electronic circuit, classifies the existing circuit is capable of generation of netlist from the photograph
elements, including active components (MOSFET, BJT, Op-Amp,
etc.), with at least 98% accuracy, and decides the circuit topology of the circuit. The developed tool admits an image of
and the connections with over 90% accuracy through a rule- the electronic circuit, classifies the circuit elements of the
based algorithm. Finally, it automatically yields a simulation- circuit with at least 98% accuracy, determines the circuit
ready netlist for the circuit of concern. It is worth noting that topology and the connections between these elements with
some CAD tools have been developed before; however, they have at least 90% accuracy with a rule-based algorithm, and
mostly focused on recognizing the circuit elements only and, to
our best knowledge, Img2Sim is the first CAD tool that creates finally yields the entire simulation-ready netlist. Img2Sim
the entire netlist for a given circuit in image format. is novel owing to (1) its ability to accurately detect active
Index Terms—Artificial Intelligence, Computer Vision, Circuit circuit components as well as the passive components, (2)
Simulation, Object Detection, Image Processing its unique algorithm ensuring high percentage of accuracy
whilst forming the node connection network for the first
I. I NTRODUCTION time in the literature, and (3) the user graphical user
Recently, artificial intelligence (AI) algorithms have been interface (GUI) enabling generation simulation-ready netlist
trending again thanks to the advances in computer hard- from circuit images instantly.
ware, so the number of AI-based applications has boomed The remainder of the paper is organised as follows. Sec-
over the last decade. AI-based algorithms have been widely tion II reviews the related works reported in the literature.
preferred in creating automated tools that facilitate the pro- The developed tool is introduced in Section III. The results
cesses by performing time-consuming tasks without human are discussed in Section IV. Finally, Section V concludes this
effort with high accuracy rates. Electronic circuit design paper.
process has also taken the advantage of AI, for example, II. R ELATED W ORKS
electronic design automation (EDA) tools have employed
AI algorithms from device/circuit modeling to circuit/layout Most of the studies on detection and analysis of cir-
synthesis tools for many years [1]–[4]. cuit elements have explored solutions to classify circuit
On the other hand, one of the most important prelim- elements by using different approaches, and there is no
inary tasks of the design process is to create a trusted well-equipped tool for automatically generating the entire
netlist for a given schematic. Conventionally, generation netlist from scratch in the literature. The task of creating the
of simulation-ready representation of circuits has been entire circuit netlist from an image is a quite challenging
manually performed by a designer. Besides, designers are process, where generation of true connection list may be
prone to make mistakes during the transfer of information a bottleneck especially considering the variety of analog
from the circuit schematic to the netlist. Further, it is circuit designs including a wide range of electronic circuit
quite difficult to detect the human-induced errors in a elements.
complicated circuit, in which even an overlooked small The study presented in [5] utilizes k-nearest neighbor-
error may substantially prolong this preliminary work. hood (KNN) algorithm to classify the target image that
is segmented by pixel distribution characteristics based
Several approaches have been proposed to automatize
on 3500 circuit element photographs. The developed algo-
the preparation of simulation-ready representation of cir-
rithm detects the circuit components with 93% accuracy.
cuits [5]–[10]. However, most of them have explored ad-
In [6], recognition of circuit elements was performed by
hoc techniques to recognize components of trivial circuits
using 2D dynamic programming technique, in which 451
including passive devices only. To our best knowledge, there
isolated symbols were used for training purposes while
is no matured tool that successfully generates the entire
more samples for training were obtained some geometrical
transformations to identify 10 different circuit elements.
978-1-6654-6703-2/22/$31.00 ©2022 IEEE The developed approach achieves over 90% recognition rate

Authorized licensed use limited to: Central China Normal University. Downloaded on November 04,2024 at 02:26:50 UTC from IEEE Xplore. Restrictions apply.
Figure 1: Sample from the circuit element recognition dataset.

for component recognition. In addition to these studies, Experts Group (JPEG) for images and text file (txt) for the
deep learning algorithms have been also employed for object coordinates in the image, the dataset is ready to
circuit element detection. To this end, analysis of hand be used in object detection model in order to analyze the
drawn circuits using deep learning architecture is presented circuit and detect all components existing in the image. For
in [7]. The proposed approach uses a Convolutional Neural the purpose of object detection, we exploited "You Only
Network (CNN) that classifies circuit elements with 95% Look Once Version Five (YOLOv5)" [11] owing to its ease
recognition rate. Similarly, a CNN based recognition of of use, high performance, and high speed. We achieved
hand-drawn circuits was proposed in [8]. A dataset with around 98% average recognition accuracy during object
863 images consisting of hand drawn circuits were used to classification with YOLOv5.
train the model that is able to estimate only 4 different
classes (resistor, capacitor, inductor, and current source)
with 84.41% accuracy. An ANN based approach for electrical
symbol detection was proposed in [9]. They used optical
character recognition (OCR) to define only the electrical
symbols in a hand-drawn circuit, in which the estimation
accuracy lies between 83%-85%. In [10], researchers devel-
oped an approach that can successfully detect digital circuit
elements and the structure of the circuit with an accuracy
ranged between 75%-95% using deep learning algorithms.

III. M ETHODOLOGY
A. Dataset
1554 circuit images derived from digital formats were
used to label 13 different circuit components. A dataset with Figure 2: Detection of the circuit elements.
11,500 labeled components (an average of 7.4 labels per
image) was formed. This dataset includes the components
tabulated in Table I. A sample of the collected images for C. Node Detection
the dataset is provided in Fig. 1. Nodes are the points in the circuit connecting at least
two different circuit elements and it is hard to detect con-
Table I: List of recognized circuit elements by Img2Sim. nections with conventional object detection models. The
Resistor Diode Power Supply proposed procedure for node detection is visually illustrated
Capacitor BJT Current Source in Fig. 3.
Inductor MOSFET DC Source To detect the nodes, wiring in the circuit must be identi-
Ground Op-Amp AC Source fied at first. To this end, we opted to the Hough Transform
Battery [12], which is a widely used and effective approach to
extract the features of an image, especially in line detection.
First, each detected line is separated into vertical and hor-
B. Circuit Element Recognition izontal components. This process is carried out by simply
Once file structures and bounding box annotations are comparing the acquired values by the Hough Transform.
prepared, where the file formats are Joint Photographic After transformation of the image, each identified line is

Authorized licensed use limited to: Central China Normal University. Downloaded on November 04,2024 at 02:26:50 UTC from IEEE Xplore. Restrictions apply.
Figure 4: a)Detection of the nodes in the circuit. b) Assign-
ment of numerical values read.

machine-encoded text. In the developed tool, the OCR is


employed to identify the texts (component names, values,
etc.) on the image and convert them into the numerical
values that are attached to the corresponding components.
Initially, we determine the center point coordinates of the
Figure 3: Procedure of the node detection process. components and the bounding box of texts. Then, each
represented by two variables namely ρ and θ, where θ is the extracted numerical value is assigned to the nearest circuit
angle between the line and the x-axis and ρ is the distance component considering its euclidean distance. Fig. 4 (right)
to the closest point on the line from the origin point that shows the assignment of numerical values (boxed) to the
is calculated according to Equation 1. corresponding circuit elements.

ρ = x cos θ + y sin θ (1) E. Connection of circuit components


As the first step, nodes are appropriately named. The
This representation of circuit lines does not point-out
algorithm checks all nodes to determine whether they
their extremities but reveals all the intersection points in
are connected to any circuit component. Then, the algo-
the circuit. In order to identify the intersection points,
rithm also checks the possible direct connections between
distinction of horizontal and vertical lines must be detected,
nodes to detect identical nodes, and all identical nodes
which is held by comparison of θ values of each lines.
are labeled with the same name. Thereafter, connections
If 3π/4 < θ < π, the line is vertical; otherwise, the line is
between the circuit elements and the nodes are established.
horizontal. Even though this separation provides all inter-
Since a circuit consists of several types of elements, and
section points, the lines may not be perfectly represented
each element has unique terminal properties, the applied
due to distortion in the images. Namely, Hough Transform
technique for each element is distinguished. For example,
returns more lines than the actual number of wires in the
circuit elements like resistors, diodes, and sources have
circuit, which results in "ghost" intersection points that
two terminals whereas a transistors have three terminals.
they never exist. To palliate this problem, the intersection
Hereby, we consider the number of terminals to assign the
points are grouped considering distance using hierarchi-
connections, where all nodes in the same direction with the
cal clustering methods, and each groups is averaged to
element’s connections are gathered, and the closest one is
identify the actual coordinates. After gathering the averaged
connected to the device . Hence, we ensure that all wires
intersection points, each point is fed into an algorithm to
leaving from an circuit is connecting at least one node.
check whether the point is a node in the circuit. The first
step of checking is finding whether the x-y coordinates are IV. R ESULTS AND D ISCUSSION
part of any component bounding boxes, and the point is
eliminated accordingly. After ensuring no nodes are on the To recapitulate the steps of the netlist generation: 1)
components, the second step is to check whether the point circuit components in the image are detected with a
is on a wire and connecting at least one horizontal and one success rate of 98% on 330 test images, 2) all nodes
vertical line. Hence, we ensure all the nodes are either in in the circuits are successfully determined on a dataset
the corner or on a junction. Fig. 4(left) shows the detected with non-deteriorated and non-crooked circuits, and 3)
nodes on a common-source amplifier circuit . texts and numerical values on the circuit are extracted to
match them with their corresponding components. After
D. Recognition of texts on the schematics the steps mentioned above are executed, the final netlist
Optical Character Recognition (OCR) method provides a of the circuit is generated. To demonstrate the proposed
conversion of handwritten or printed text images into the tool, re-created schematics of two circuits (pure resistive

Authorized licensed use limited to: Central China Normal University. Downloaded on November 04,2024 at 02:26:50 UTC from IEEE Xplore. Restrictions apply.
Figure 5: Re-created schematics and corresponding netlists generated by Img2Sim.

Table II: Comparison results.


Number of components- Detection of
Technique Active Device Netlist Generation
Classification Accuracy Component Values
This work (Img2Sim) CNN 14-98% Yes Yes-OCR Yes- 90%
[5] KNN 35-93% Yes No No
[6] CNN 3-95% No No No
[7] 2D-DP 7-90.3% Yes No No
[8] CNN 4-84.4% No No No

network and self-biased common-source/drain amplifier) Comparator using Artificial Neural Networks.” International Journal
and generated netlists are provided in Fig. 5. As can be seen of Electrical & Computer Engineering (2088-8708), vol. 6, no. 1, 2016.
[2] Pan, Po-Cheng and Huang, Chien-Chia and Chen, Hung-Ming, “Late
from the results, all components and their values have been breaking results: An efficient learning-based approach for perfor-
successfully captured by the developed tool, where question mance exploration on analog and RF circuit synthesis,” in 2019 56th
marks represent non-valued components in the schematics. ACM/IEEE Design Automation Conference (DAC). IEEE, 2019, pp. 1–2.
[3] İslamoğlu, Gamze and Çakici, Tuğberk Oğulcan and Afacan, Engin
The comparison results of the developed tool with the and Dündar, Günhan, “Artificial neural network assisted analog IC
other approaches reported in the literature are given in Ta- sizing tool,” in 2019 16th International Conference on Synthesis, Mod-
ble II. According to the results, Img2Sim outperforms other eling, Analysis and Simulation Methods and Applications to Circuit
Design (SMACD). IEEE, 2019, pp. 9–12.
approaches in terms of component classification accuracy [4] Watson, Paul M and Gupta, Kuldip C, “Design and optimization of
(98%), whereas the approach presented in [5] can recognize CPW circuits using EM-ANN models for CPW components,” IEEE
the maximum number of components (35). Furthermore, Transactions on Microwave Theory and Techniques, vol. 45, no. 12,
pp. 2515–2523, 1997.
Img2Sim provides particular features of component value [5] Huoming, Zhang and Lixing, Shao, “Research on K nearest neighbor
detection and automatic netlist generation, which put it identification of hand-drawn circuit diagram,” in Journal of Physics:
considerably forward from the others. Also, it is worth Conference Series, vol. 1325, no. 1. IOP Publishing, 2019, p. 012233.
[6] Feng, Guihuan and Viard-Gaudin, Christian and Sun, Zhengxing,
noting that Img2Sim is the only tool that also exhibits a “On-line hand-drawn electric circuit diagram recognition using 2D
user-friendly GUI. dynamic programming,” Pattern Recognition, vol. 42, no. 12, pp. 3215–
3223, 2009.
V. C ONCLUSION [7] Wang, Haiyan and Pan, Tianhong and Ahsan, Mian Khuram, “Hand-
drawn electronic component recognition using deep learning algo-
In this study, Img2Sim, an ANN based automatic netlist rithm,” International Journal of Computer Applications in Technology,
generator tool, is presented. The proposed tool acquires vol. 62, no. 1, pp. 13–19, 2020.
[8] Günay, Mihriban and Köseoğlu, Murat and Yıldırım, Özal, “Clas-
the circuit schematic in image format, detects the circuit sification of hand-drawn basic circuit components using convolu-
components from given images with over 98% accuracy, tional neural networks,” in 2020 International Congress on Human-
determines the connections by detecting the lines and the Computer Interaction, Optimization and Robotic Applications (HORA).
IEEE, 2020, pp. 1–5.
nodes, extracts text and numerical values to assign them [9] Rabbani, Mahdi and Khoshkangini, Reza and Nagendraswamy, HS
to corresponding components, and ultimately generates a and Conti, Mauro, “Hand drawn optical circuit recognition,” Procedia
simulation-ready netlist of the circuit with 90% accuracy. Computer Science, vol. 84, pp. 41–48, 2016.
[10] Altun, Oğuz and Nooruldeen, Orhan, “SKETRACK: stroke-based
To our best knowledge, Img2Sim is the first application that recognition of online hand-drawn sketches of arrow-connected di-
generates the entire netlist for a given circuit from scratch. agrams and digital logic circuit diagrams,” Scientific Programming,
vol. 2019, 2019.
R EFERENCES [11] Jocher, Glenn and Nishimura, K and Mineeva, T and Vilariño, R,
“yolov5,” Code repository https://github. com/ultralytics/yolov5, 2020.
[1] Bhatia, Veepsa and Pandey, Neeta and Bhattacharyya, Asok, “Mod- [12] Hough, Paul VC, “Method and means for recognizing complex pat-
elling and Design of Inverter Threshold Quantization Based Current terns,” Dec. 18 1962, US Patent 3,069,654.

Authorized licensed use limited to: Central China Normal University. Downloaded on November 04,2024 at 02:26:50 UTC from IEEE Xplore. Restrictions apply.

You might also like