CircuitCoach AI — YOLO26n electronic component detector
Detects 61 kinds of electronic and robotics components (Arduino boards, sensors, modules, passive parts, switches, displays…) in a photo and returns a box, a class name and a confidence for each one. It is the detection model behind CircuitCoach AI, a learning assistant that tells beginners what a part is and what it does.
- Model: Ultralytics YOLO26n (2.4 M parameters), fine-tuned from COCO-pretrained weights
- Data: ElectroCom61 (CC BY 4.0), cleaned and re-split by the author of this model
- Formats: PyTorch
.pt, ONNX (used by the web demo), LiteRT float32.tflite, LiteRT w8a32.tflite(for Android)
Try it: CircuitCoach AI web demo — runs in your browser, photos never leave your device. Code: github.com/Jatheel/circuitcoach-ai
Safety: for low-voltage (5 V or less) learning circuits. Not a safety check. Never use on mains wiring. The model names parts; it does not check whether a circuit is correct or safe.
Results on the held-out test split
1294 boxes in 230 images that were never used for training or model selection.
| Metric | Value |
|---|---|
| Precision | 0.926 |
| Recall | 0.940 |
| mAP50 | 0.958 |
| mAP50-95 | 0.649 |
| Inference (NVIDIA T4, PyTorch) | 5.2 ms / image |
At confidence 0.25 (IoU 0.5): 1208 of 1294 parts found with the right name, 14 wrong class, 72 missed, 97 extra boxes.
These are in-lab numbers. Test images come from the same lab as the training images. Expect lower accuracy on your own desk.
Phone test (real-world)
Not measured yet. A separate set of phone photos taken outside the original lab will be reported here.
Weakest classes
| Class | Test boxes | P | R | mAP50 | mAP50-95 |
|---|---|---|---|---|---|
| Zener-Diode | 23 | 0.74 | 0.78 | 0.730 | 0.371 |
| Tact-Switch | 21 | 0.79 | 0.89 | 0.816 | 0.349 |
| Motor-Driver | 18 | 0.88 | 0.78 | 0.825 | 0.658 |
| Push-Switch | 26 | 0.78 | 0.81 | 0.855 | 0.437 |
| Buzzer | 26 | 0.82 | 0.81 | 0.867 | 0.498 |
| BJT-Transistor | 23 | 0.93 | 0.59 | 0.878 | 0.441 |
| Capacitor-10mf | 22 | 0.84 | 0.82 | 0.882 | 0.526 |
| Fuse | 18 | 0.97 | 0.78 | 0.905 | 0.568 |
| Servo-Motor | 17 | 0.89 | 0.92 | 0.917 | 0.633 |
| Keypad | 19 | 0.75 | 0.89 | 0.925 | 0.681 |
| Class | Test boxes | P | R | mAP50 | mAP50-95 |
|---|---|---|---|---|---|
| 1-5-Volt-Battery | 22 | 0.97 | 1.00 | 0.995 | 0.629 |
| 3-3-Volt-Battery | 21 | 0.96 | 0.95 | 0.989 | 0.729 |
| 7-Segment-Display | 19 | 0.90 | 0.99 | 0.946 | 0.626 |
| 9-Volt-Battery | 17 | 0.92 | 1.00 | 0.943 | 0.712 |
| Arduino-Mega | 18 | 0.95 | 0.99 | 0.992 | 0.868 |
| Arduino-Nano | 19 | 0.86 | 1.00 | 0.933 | 0.661 |
| Arduino-Uno | 20 | 0.98 | 1.00 | 0.995 | 0.867 |
| BJT-Transistor | 23 | 0.93 | 0.59 | 0.878 | 0.441 |
| Bluetooth-Module | 25 | 0.99 | 0.92 | 0.978 | 0.729 |
| Breadboard | 18 | 0.92 | 1.00 | 0.995 | 0.873 |
| Bridge-Rectifier | 22 | 0.95 | 0.94 | 0.979 | 0.749 |
| Buck-Converter | 17 | 1.00 | 0.97 | 0.995 | 0.783 |
| Buzzer | 26 | 0.82 | 0.81 | 0.867 | 0.498 |
| Capacitor-10mf | 22 | 0.84 | 0.82 | 0.882 | 0.526 |
| Capacitor-470mf | 22 | 0.95 | 0.91 | 0.971 | 0.623 |
| DC-Motor | 18 | 0.97 | 1.00 | 0.995 | 0.591 |
| Diode | 26 | 0.89 | 0.96 | 0.945 | 0.572 |
| ESP32 | 19 | 0.98 | 1.00 | 0.995 | 0.790 |
| ESP32-CAM | 19 | 0.97 | 1.00 | 0.995 | 0.741 |
| FT-232-USB-Serial-Module | 17 | 0.97 | 1.00 | 0.995 | 0.706 |
| Film-Capacitor | 19 | 0.91 | 0.89 | 0.936 | 0.691 |
| Fuse | 18 | 0.97 | 0.78 | 0.905 | 0.568 |
| Fuse-Base | 18 | 1.00 | 0.99 | 0.995 | 0.736 |
| GSM-Module | 23 | 0.96 | 0.98 | 0.965 | 0.679 |
| Gas-Sensor | 23 | 0.96 | 0.96 | 0.988 | 0.742 |
| Heat-Sink | 18 | 0.97 | 1.00 | 0.995 | 0.840 |
| High-Voltage-Ceramic-Capacitor | 26 | 0.98 | 1.00 | 0.995 | 0.569 |
| Humidity-Sensor | 23 | 0.88 | 1.00 | 0.992 | 0.748 |
| IC-Base-14-Pin | 23 | 0.95 | 0.90 | 0.942 | 0.615 |
| IC-Base-28-Pin | 22 | 0.97 | 1.00 | 0.995 | 0.745 |
| IC-Chip | 33 | 0.93 | 0.91 | 0.976 | 0.531 |
| IGBT | 21 | 1.00 | 0.86 | 0.991 | 0.619 |
| IR-Sensor | 22 | 0.96 | 0.95 | 0.955 | 0.556 |
| Inductor | 29 | 0.96 | 1.00 | 0.995 | 0.503 |
| Keypad | 19 | 0.75 | 0.89 | 0.925 | 0.681 |
| LCD-Display | 17 | 0.85 | 1.00 | 0.943 | 0.764 |
| LDR-Sensor | 17 | 0.99 | 1.00 | 0.995 | 0.640 |
| LED-Light | 30 | 0.97 | 1.00 | 0.995 | 0.627 |
| Low-Voltage-Ceramic-Capacitor | 21 | 0.82 | 0.90 | 0.966 | 0.480 |
| MLC-Capacitor | 31 | 0.99 | 0.97 | 0.987 | 0.546 |
| MOSFET | 21 | 0.94 | 0.90 | 0.952 | 0.499 |
| Motion-Sensor | 23 | 0.94 | 1.00 | 0.986 | 0.796 |
| Motor-Driver | 18 | 0.88 | 0.78 | 0.825 | 0.658 |
| NTC-Thermistor | 22 | 0.87 | 0.86 | 0.935 | 0.456 |
| OLED-Display | 28 | 0.98 | 1.00 | 0.995 | 0.759 |
| Pin-Header | 18 | 0.88 | 0.83 | 0.954 | 0.578 |
| Push-Switch | 26 | 0.78 | 0.81 | 0.855 | 0.437 |
| RFID-Scanner | 16 | 0.87 | 1.00 | 0.995 | 0.854 |
| Raindrops-Module | 19 | 0.98 | 1.00 | 0.995 | 0.822 |
| Relay-Module | 22 | 0.84 | 1.00 | 0.980 | 0.814 |
| Resistor | 18 | 0.84 | 0.89 | 0.925 | 0.611 |
| Rocker-Switch | 18 | 0.97 | 1.00 | 0.995 | 0.604 |
| Servo-Motor | 17 | 0.89 | 0.92 | 0.917 | 0.633 |
| Soil-Moisture-Sensor | 19 | 1.00 | 0.98 | 0.995 | 0.672 |
| Sonar-Sensor | 22 | 0.93 | 1.00 | 0.991 | 0.742 |
| TCRT5000 | 17 | 0.93 | 0.94 | 0.945 | 0.485 |
| Tact-Switch | 21 | 0.79 | 0.89 | 0.816 | 0.349 |
| Taper-Potentiometer | 18 | 1.00 | 0.99 | 0.995 | 0.502 |
| Trimmer-Potentiometer | 23 | 1.00 | 0.91 | 0.953 | 0.533 |
| Water-Sensor | 22 | 0.94 | 1.00 | 0.995 | 0.808 |
| Zener-Diode | 23 | 0.74 | 0.78 | 0.730 | 0.371 |
Failure analysis
- Classification is reliable: at confidence 0.25, only 14 of 1294 test boxes received the wrong class; most errors are missed parts (72) or extra boxes (97).
- Look-alike small parts cause most errors: small dark round parts (buzzer, push switch, inductor) and two-lead parts (Zener diode, diode, resistor, small capacitors).
- Background objects: in photos with a room or floor behind the parts, the model can draw low-confidence boxes on furniture or people; the dataset has no component-free images.
- Blur and angle: out-of-focus parts get overlapping low-confidence boxes, steeply angled parts are missed, and small parts have the loosest boxes.
- Single-lab data: all images come from one lab, so accuracy on other desks and lighting is lower than the numbers below; see the phone-test section.
Files
| File | Format | Size | Test mAP50 | Use |
|---|---|---|---|---|
circuitcoach-yolo26n.pt | PyTorch | 5.52 MB | 0.958 | Python |
circuitcoach-yolo26n.onnx | ONNX, NMS embedded (output [1, 300, 6]) | 9.94 MB | 0.920* | Web demo (ONNX Runtime Web) |
circuitcoach-yolo26n.tflite | LiteRT float32 | 9.95 MB | 0.945* | Full-precision mobile reference |
circuitcoach-yolo26n_w8a32.tflite | LiteRT int8 weights, float activations | 2.87 MB | 0.944* | For Android (app planned) |
* Validator mAP for exported files is lower than PyTorch because their built-in post-processing drops very-low-confidence boxes that mAP counts. At confidence 0.4, both the ONNX and float32 LiteRT models returned the same 160 of 160 boxes as PyTorch on 25 test images.
Export check: at confidence 0.4 the float32 LiteRT model returned the same boxes as PyTorch on 25 test images (160 of 160 boxes matched, mean IoU 1.000). The validator's LiteRT mAP50-95 (0.553 float32 / 0.557 w8a32) is lower than PyTorch's (0.649); this comes from how very-low-confidence boxes are handled during validation, not from different detections at working thresholds. w8a32 loses 0.07 mAP50 points against float32 and is about 3.5x smaller, so it is the file planned for the Android app.
Other files: data.yaml (class names), metrics/ (test metrics, per-class results, confusion
matrix, export report), training/ (training arguments and curves), dataset/ (cleaning audit).
How to use
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
path = hf_hub_download("JatheelMHD/circuitcoach-yolo26n", "circuitcoach-yolo26n.pt")
model = YOLO(path)
results = model.predict("my_parts.jpg", conf=0.4)
results[0].show()
A confidence of about 0.4 is recommended: it removes most low-confidence boxes on background objects while keeping confident detections.
Training data
ElectroCom61 — 2121 images of 61 component classes photographed in the Electronic Lab Support Room of United International University, Dhaka, with several smartphones, varied lighting, backgrounds and angles. Images were resized to 640×640 by the dataset authors, which stretches some of them. Licence: CC BY 4.0.
Changes made for this model (dataset not redistributed here; the scripts are in the project repository):
- Merged the original train/valid/test splits into one pool.
- Checked every image and label line (2121 images scanned; checks: {'near_duplicate_pairs': 17}).
- Grouped exact duplicates, near-duplicates (64-bit difference hash, distance ≤ 6) and copies of the same source photo, giving 2104 groups.
- Re-split 75/15/10 by group and stratified by class, so near-identical photos never sit on both sides of the train/test line: 1569 train / 322 val / 230 test images. Every class appears in all three splits.
Because of this grouped re-split, the numbers here are not directly comparable with the dataset paper's results on its random split.
Training
| Setting | Value |
|---|---|
| Base model | yolo26n.pt (pretrained) |
| Image size | 640 |
| Epochs | 100 (early stopping off; best epoch selected on validation) |
| Batch size | 32 |
| Optimizer | auto (Ultralytics automatic choice) |
| Extra augmentation | rotation ±10°, vertical flip p=0.5, plus Ultralytics defaults |
| Seed | 0, deterministic=True |
| Hardware | Kaggle, 1× NVIDIA Tesla T4 |
| Ultralytics | 8.4.215 |
Limitations
- Trained on photos from a single lab; accuracy drops on unfamiliar backgrounds and lighting.
- Cannot read component values (resistor colour bands, capacitor ratings) or exact model numbers.
- Cannot tell genuine boards from clones.
- Look-alike parts (diode vs Zener diode, push vs tact switch, small capacitors) can be confused.
- Does not trace wires or verify circuits.
Licence and credit
- Model weights: AGPL-3.0 (models trained with Ultralytics code fall under AGPL-3.0).
- Dataset: ElectroCom61 by Sayeedi et al., CC BY 4.0, used with the changes listed above. Original data: https://data.mendeley.com/datasets/6scy6h8sjz/2
@article{sayeedi2025electrocom61,
title = {ElectroCom61: A multiclass dataset for detection of electronic components},
author = {Sayeedi, Md. Faiyaz Abdullah and Osmani, Anas Mohammad Ishfaqul Muktadir and
Rahman, Taimur and Deepti, Jannatul Ferdous and Rahman, Raiyan and Islam, Salekul},
journal = {Data in Brief},
volume = {59},
pages = {111331},
year = {2025},
doi = {10.1016/j.dib.2025.111331}
}