File size: 8,079 Bytes
7536cf1 51e96a1 7536cf1 51e96a1 7536cf1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | ---
task_categories:
- image-segmentation
- object-detection
tags:
- computer-vision
- instance-segmentation
- resistor-detection
- electronics
- object-counting
- yolo
- roboflow
- opencv
size_categories:
- n<1K
---
# Resistor Segmentation V4 Dataset
A custom image dataset developed for resistor-body detection, instance segmentation and automated component counting using conventional image processing and deep learning.
## Dataset Overview
This dataset was developed as part of a Machine Vision group project at the University of the West of England (UWE Bristol).
It contains self-captured photographs of multiple resistors, representing variations in body colour, orientation, scale, colour-band appearance, illumination and overlapping metal leads.
The dataset supports the development and evaluation of computer vision models for electronic component detection, segmentation, counting and extraction.
## Dataset Statistics
| Property | Value |
|---|---|
| Total annotated images | 181 |
| Total annotated instances | 1,286 |
| Number of classes | 1 |
| Class name | Resistor |
| Annotation type | Instance segmentation polygons |
| Annotation format | YOLO segmentation |
| Image source | Self-captured photographs |
| Annotation platform | Roboflow |
## Dataset Distribution
| Split | Images | Resistor Instances |
|---|---:|---:|
| Training | 116 | 771 |
| Validation | 27 | 194 |
| Testing | 38 | 321 |
| **Total** | **181** | **1,286** |
Capture-based grouping was implemented to reduce potential data leakage between training, validation and testing datasets. No overlap was present between the defined capture groups assigned to each split.
## Dataset Characteristics
The dataset includes:
- Multiple resistors within individual photographs.
- Four-band and five-band resistors.
- Different resistor-body colours and physical dimensions.
- Horizontal, vertical and diagonal orientations.
- Overlapping and intersecting metal leads.
- Variations in lighting, shadows and reflections.
- Different object scales and image compositions.
Annotations primarily cover the resistor bodies rather than their metal leads, supporting individual instance extraction and downstream colour-band analysis.
## Dataset Development
The dataset was developed through the following stages:
1. Collection of original resistor photographs.
2. Image filtering and quality inspection.
3. Manual bounding-box annotation.
4. Capture-based dataset splitting.
5. Automatic segmentation polygon generation using conventional image processing.
6. Morphological processing and contour extraction.
7. Convex hull refinement to improve mask continuity.
8. Manual review and correction of segmentation annotations in Roboflow.
9. Export in YOLO-compatible segmentation format.
10. Verification of image counts, annotation counts and dataset split consistency.
The combination of automated polygon generation and manual verification reduced annotation effort while improving segmentation quality.
## Repository Contents
| Filename | Description |
|---|---|
| `Resistor Segmentation V4 Verified Dataset.zip` | Final manually reviewed and annotated segmentation dataset |
| `Resistor Images - V2.zip` | Original resistor photograph collection |
The verified segmentation dataset is recommended for model training and evaluation. The original image archive is provided as supporting source material.
## Dataset Structure
After extracting the verified segmentation dataset:
```text
Resistor Segmentation V4 Verified Dataset/
├── train/
│ ├── images/
│ └── labels/
├── valid/
│ ├── images/
│ └── labels/
├── test/
│ ├── images/
│ └── labels/
├── data.yaml
└── README.roboflow.txt
```
## Annotation Format
Each resistor instance is represented by a segmentation polygon using normalised image coordinates in YOLO format.
```text
class_id x1 y1 x2 y2 ... xn yn
```
The dataset contains a single object class:
```text
0: resistor
```
Polygon annotations represent individual resistor bodies and allow models to distinguish separate instances within the same photograph.
The annotations do not individually identify resistor colour bands or their colours.
## Supported Tasks
- Object detection
- Instance segmentation
- Automated resistor counting
- Electronic component localisation
- Region of interest extraction
- Mask-based orientation correction
- Preprocessing for resistor colour-band recognition
## Model Development and Evaluation
The dataset was used to train and compare three instance segmentation architectures:
- YOLOv8n-seg
- YOLO11n-seg
- YOLO26n-seg
All three architectures were trained using consistent experimental settings to support comparative evaluation.
YOLO26n-seg was selected for the final resistor detection pipeline based on its validation segmentation performance and optimised detection F1-score.
## Benchmark Results
The following results were obtained using the selected YOLO26n-seg model with morphological mask refinement on the held-out test dataset.
| Metric | Result |
|---|---:|
| Test images | 38 |
| Ground-truth resistor instances | 321 |
| Correct detections | 314 |
| False positives | 0 |
| False negatives | 7 |
| Detection recall | 97.82% |
| Detection F1-score | 98.90% |
| Counting MAE | 0.184 |
| Counting RMSE | 0.487 |
| Exact counting accuracy | 84.21% |
| GT-normalised mask IoU | 84.79% |
The raw YOLO26n-seg model additionally achieved:
| Standard YOLO Metric | Result |
|---|---:|
| Box mAP50 | 99.98% |
| Box mAP50–95 | 83.29% |
| Mask mAP50 | 99.98% |
| Mask mAP50–95 | 69.77% |
These results describe resistor-body detection and segmentation performance, rather than colour-band classification accuracy.
## Related Model
The trained model, complete development notebook, methodology, evaluation results and extraction examples are available in the associated Hugging Face model repository:
[YOLO26n Resistor Detection and Instance Segmentation](https://huggingface.co/Marley07/YOLO26n-Resistor-Segmentation)
## Intended Use
This dataset is intended for educational and research applications involving computer vision, electronic component recognition, instance segmentation and automated object counting.
Potential applications include electronics inspection research, industrial machine vision, component localisation and automated resistor image analysis.
The dataset has not been validated for production-level industrial inspection.
## Limitations
- The dataset is relatively small compared with large-scale computer vision benchmarks.
- Most photographs were captured within a limited range of environments.
- The held-out test dataset contains only two defined capture groups.
- Smaller or blurred resistor bodies may be difficult to detect.
- Reflections, shadows and overlapping metal leads may affect segmentation quality.
- Some annotation boundaries may contain minor inaccuracies.
- Capture-based grouping reduces but cannot entirely eliminate potential similarities between dataset splits.
- Additional data collection is required to establish generalisation across different cameras, backgrounds and industrial environments.
## Technologies and Tools
- Python
- OpenCV
- NumPy
- PyTorch
- Ultralytics YOLO
- Roboflow
- Google Colab
## Author
**Dinesh Kumar**
Machine Vision — University of Bristol and University of the West of England, Bristol, United Kingdom.
Developed as an individual technical contribution within a collaborative university Machine Vision project.
## Acknowledgements
This dataset was developed within a collaborative Machine Vision group project investigating object counting across agricultural and electronic component applications.
The wider project combines conventional image processing and machine learning for apple counting and resistor colour-band recognition.
## Licence and Usage
Dataset redistribution and usage are subject to confirmation of the relevant ownership, contributor permissions and university assessment-sharing requirements. |