Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    ValueError
Message:      Invalid string class label Resistor-Segmentation-V4-Dataset@6ef81b4fb517c12ab52e5c3d9e3ff3d417825fc9
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 150, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 274, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 130, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 579, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3074, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2591, in __iter__
                  example = _apply_feature_types_on_example(
                      example, self.features, token_per_repo_id=self.token_per_repo_id
                  )
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2508, in _apply_feature_types_on_example
                  encoded_example = features.encode_example(example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 2252, in encode_example
                  return encode_nested_example(self, example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1526, in encode_nested_example
                  {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema}
                      ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1549, in encode_nested_example
                  return schema.encode_example(obj) if obj is not None else None
                         ~~~~~~~~~~~~~~~~~~~~~^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1210, in encode_example
                  example_data = self.str2int(example_data)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1147, in str2int
                  output = [self._strval2int(value) for value in values]
                            ~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1168, in _strval2int
                  raise ValueError(f"Invalid string class label {value}")
              ValueError: Invalid string class label Resistor-Segmentation-V4-Dataset@6ef81b4fb517c12ab52e5c3d9e3ff3d417825fc9

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

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:

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.

class_id x1 y1 x2 y2 ... xn yn

The dataset contains a single object class:

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

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.

Downloads last month
-

Models trained or fine-tuned on Marley07/Resistor-Segmentation-V4-Dataset