Skip to content

Latest commit

 

History

History
108 lines (85 loc) · 4.66 KB

README.md

File metadata and controls

108 lines (85 loc) · 4.66 KB
Logo

CircuitNet

Schematic Sketch to Circuit Diagram Using Deep Learning
Interactive Colab Demo »

Table of Contents

Introduction

CircuitNet aims to automate the conversion of hand-drawn circuit sketches into professional circuit diagrams using deep learning. The system combines traditional image processing for component detection with a CNN for classification, achieving 90% detection and 96.5% classification accuracy across 5 common circuit components.

Installation

To install CircuitNet, follow these steps:

  1. Clone the repository:
    git clone https://github.com/aaanthonyyy/CircuitNet.git
    cd CircuitNet
  2. Activate the virtual environment:
    python -m venv circuitnet
    source circuitnet/bin/activate
  3. Install the dependencies:
    pip install -r requirements.txt

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project Overview

Note

The project is divided into 3 main components: component detection, component classification, and circuit generation. The following sections provide an overview of each component.

Logo

Dataset

The dataset used in this project consists of 3,191 images (including augmented data). The original dataset was sourced from mahmut-aksakalli/circuit_recognizer and was further augmented to improve model performance.

The dataset is located in the dataset/ directory of this repository and includes:

  • Original circuit component images
  • Augmented variations of the original images
  • Additional handcrafted component images

Extract the dataset:

cd dataset/
tar -xzvf circuit_dataset.tar.gz

Notebooks

  • neural_network.ipynb: This notebook is where the neural network is trained to predict the circuit components.
  • object_detection.ipynb: This notebook covers the image processing algorithm used to detect circuit components.
  • circuit_generation.ipynb: This notebook takes the detected and classified components to generate an SVG/PNG of the circuit.

Component Classification

Logo

The component classification model was trained using a Convolutional Neural Network (CNN) with 5 classes: resistor, capacitor, inductor, voltage source, and current source. The model achieved an accuracy of 96.5% on the test set.

Component Segmentation

Logo

There are a variety of feature detection algorithms possible, but we opted for traditional image processing techniques due to the inavailability of labeled data.

Circuit Generation

The circuit generation pipeline transforms detected components into a complete circuit diagram through a three-stage process. First, the detected and classified components are processed to establish their spatial relationships and mapped to standardized circuit elements. Next, these processed components are used to automatically generate a JSON netlist that defines all component connections while preserving the original circuit topology. Finally, this netlist is rendered into an SVG circuit diagram using a rule-based placement system, which can then be exported to PNG format for easy visualization


Acknowledgements

I would like to express my sincere gratitude to Dr. Akash Pooransingh, my project supervisor, for his invaluable guidance, expertise and encouragement throughout this research project. His insights into machine learning applications in electrical engineering and consistent support were instrumental in bringing this project to fruition.