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.
To install CircuitNet, follow these steps:
- Clone the repository:
git clone https://github.com/aaanthonyyy/CircuitNet.git cd CircuitNet
- Activate the virtual environment:
python -m venv circuitnet source circuitnet/bin/activate
- Install the dependencies:
pip install -r requirements.txt
This project is licensed under the MIT License. See the LICENSE file for details.
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.
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
cd dataset/
tar -xzvf circuit_dataset.tar.gz
- 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.
There are a variety of feature detection algorithms possible, but we opted for traditional image processing techniques due to the inavailability of labeled data.
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
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.