plastic-caps / README.md
github-actions[bot]
Dataset release v1.0.0
ff9b9fe
metadata
pretty_name: Plastic Caps Dataset
language: en
license: cc-by-4.0
task_categories:
  - image-classification
tags:
  - plastic
  - caps
  - classification
  - computer-vision
  - multi-view
  - controlled-environment
  - grouped-splits
  - recycling
  - sustainability
size_categories:
  - 1K<n<10K

Plastic Caps Dataset

Dataset Summary

This dataset contains images of plastic caps categorized by the color. The dataset is divided into training, validation, and test splits using a leakage-safe strategy that groups all images of the same physical cap together in the same split while maintaining balanced color distributions across subsets.

Supported Tasks

  • The initial and primary purpose of this dataset is Color classification (target label: color_category)

Dataset Structure

Data Fields

  • image: Image object containing the image data and associated metadata (loaded by the Hugging Face datasets library).
  • cap_id: A string (UUID) as the unique identifier for each physical cap.
  • cap_type: Categorical label indicating the physical design of the plastic cap: disc/press top cap, dual flip-top cap, flip-top cap, hinged cap, push-pull/sports cap, standard cap, tethered yorker cap, twist cap and yorker spout cap.
  • cap_rotation: An integer indicating the rotation of the cap, 12, 3, 6 meaning the cap is rotated to the 12 o'clock, 3 o'clock and 6 o'clock positions, respectively.
  • cap_state: A string, for normal caps: "0", "1" indicating if the cap is closed or open. In the case of dual-flip caps "00", "01", "10", "11" indicating the state of each lid (both closed, lid a open, lid b open, both open).
  • cap_facing_position: An integer, either 0 or 1, indicating if the cap is facing downwards or upwards, respectively.
  • camera_angle: An integer, indicating the angle of the camera when the image was taken (90, 45 or 0 degrees).
  • color_category: Categorical label representing grouped color classes used in recycling workflows, following Tapitas Oportunidades – Colores (one of red/orange/pink/fuchsia/brown, yellow/gold, blue, green, white/transparent, silver/gray and black).

Data Instances

Images

  • Total images: 2662

Color distribution (images):

  • black: 263
  • blue: 278
  • green: 412
  • red / orange / pink / fuchsia / brown: 583
  • silver / gray: 94
  • white / transparent: 836
  • yellow / gold: 196

Caps (Unique Physical Objects)

  • Total unique caps: 239

Color distribution (caps):

  • black: 25
  • blue: 28
  • green: 33
  • red / orange / pink / fuchsia / brown: 46
  • silver / gray: 12
  • white / transparent: 77
  • yellow / gold: 18

Data Splits

The dataset is split into training, validation, and test subsets using a deterministic and stratified splitting strategy designed to prevent data leakage and preserve distributional balance.

  • Grouping key: All samples are grouped by cap_id, ensuring that images of the same physical object do not appear across different splits.
  • Stratification: The split is stratified by color_category to maintain consistent distributions across subsets.
  • Split ratios:
    • Train: 80%
    • Validation: 10%
    • Test: 10%

Images / Color distribution (%)

Dataset Split Number of Images Black Blue Green Red / orange / pink / fuchsia / brown Silver / gray White / transparent Yellow / gold
Train 2,110 11.0% 10.4% 14.4% 24.0% 2.8% 30.1% 7.1%
Validation 254 4.7% 7.1% 18.1% 18.1% 2.4% 44.9% 4.7%
Test 298 6.0% 13.4% 20.8% 10.1% 9.4% 28.9% 11.4%

Caps / Color distribution (%)

Dataset Split Number of Caps Black Blue Green Red / orange / pink / fuchsia / brown Silver / gray White / transparent Yellow / gold
Train 191 10.5% 11.5% 13.6% 19.4% 5.2% 32.5% 7.3%
Validation 24 8.3% 12.5% 16.7% 16.7% 4.2% 33.3% 8.3%
Test 24 12.5% 12.5% 12.5% 20.8% 4.2% 29.2% 8.3%

Dataset Creation

This dataset contains images of plastic caps collected in-house by the author. Each cap is labeled with a color category, following Tapitas Oportunidades – Colores, and a cap type, defined as metadata. All images are provided at their original resolution of 224×224 pixels in RGB format.

The cap type determines the image capture strategy, including the number of images per cap, camera angles, rotational variations, facing position, and cap state (open or closed). This ensures that each cap is represented through multiple views appropriate to its physical design, providing diverse visual data for downstream tasks.

These plastic caps are used in non-profit initiatives to produce accessible products, such as retractable walkways and amphibious chairs, as described on the Donatapa website. The labels reflect both practical usage categories and the intended applications of the caps.

Curation Rationale

The plastic caps dataset was designed to support research in computer vision, specifically for classification and analysis of colors and cap types in applications related to social impact and sustainability.

Source Data

The data was obtained by capturing multi-view images of plastic caps using a fixed camera setup in a controlled environment. No third-party datasets were used.

Annotations

The dataset does not contain any additional annotations.

Personal and Sensitive Information

The dataset does not contain any personal or sensitive information.

Versioning

We use Semantic Versioning (SemVer) for versioning our dataset, meaning we follow the MAJOR.MINOR.PATCH version pattern and the following versioning policy:

MAJOR version

Incremented when changes break backward compatibility including:

  • Schema changes (renaming or removing fields)
  • Data type changes.
  • Changes in the semantic meaning of existing fields
  • Modifications to label definitions or class taxonomies
  • Restructuring of dataset splits (train/validation/test)
  • Any change that invalidates direct comparison with previous results

MINOR version

Incremented for backward-compatible extensions such as:

  • Addition of new columns or metadata fields
  • Addition of new classes without modifying existing ones
  • Inclusion of additional samples or images
  • Addition of new dataset splits
  • Improvements to documentation or dataset metadata

PATCH version

Incremented for non-semantic corrections like:

  • Fixes to metadata errors
  • Small-scale correction of mislabeled samples
  • Replacement of corrupted files
  • Corrections to dataset card

For the versions available, see the tags in the dataset repository.

License

This dataset is released under Creative Commons Attribution 4.0 International (CC-BY-4.0) license.

Citation

If you use this dataset in your research, please cite:

@dataset{garcia2026plasticcaps,
    title = {Plastic Caps Dataset},
    author = {García, Sebastián},
    year = {2026},
    publisher = {Hugging Face},
    url = {https://huggingface.co/datasets/sebastiangv/plastic-caps}
}