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 zanzibar_cloves@16453c3df14ab2f089c86be8392b16f1ae9b636d
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 149, 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 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 129, 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 489, 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 2818, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2368, 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 2285, 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 2162, in encode_example
                  return encode_nested_example(self, example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1446, 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 1469, 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 1144, in encode_example
                  example_data = self.str2int(example_data)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1081, in str2int
                  output = [self._strval2int(value) for value in values]
                            ~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1102, in _strval2int
                  raise ValueError(f"Invalid string class label {value}")
              ValueError: Invalid string class label zanzibar_cloves@16453c3df14ab2f089c86be8392b16f1ae9b636d

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.

Zanzibar Clove Grading Dataset

A multi-resolution image dataset of Zanzibar whole cloves graded according to the official standards of the Zanzibar State Trading Corporation (ZSTC). This is the first publicly available clove dataset with labels assigned by consensus among three ZSTC-certified inspectors, covering both individual cloves and real-world batch pile images.


Dataset Summary

Property Details
Total images 5,898
Single-clove images 5,298
Batch pile images 600
Number of classes 4 (Grade I Β· Grade II Β· Grade III Β· Grade IV)
Resolutions available 224 Γ— 224 px Β· 512 Γ— 512 px
Label source 3 ZSTC-certified inspectors (consensus agreement)
Capture device Samsung Galaxy S21 Ultra 5G (SM-G998B/DS)
Capture location ZSTC Saateni Warehouse, Unguja, Zanzibar, Tanzania
License MIT

Grading Standard

Labels follow the ZSTC official quantitative grading thresholds for Zanzibar whole cloves:

Grade Primary Visual Attribute Mpeta (%) Foreign Matter (%)
Grade I Attractive golden colour ≀ 3% ≀ 5%
Grade II Faded / blackish colour ≀ 7% ≀ 5%
Grade III More faded colour ≀ 20% ≀ 5%
Grade IV Primarily mpeta > 20% β€”

Mpeta (also known internationally as khoker clove) refers to fermented, hollow cloves whose proportion within a batch is the primary determinant of grade assignment.


Dataset Structure

Each repository contains two top-level folders β€” single_clove/ for individual clove images and batch/ for pile images β€” each organised by grade:

zanzibar_cloves_224/          (or zanzibar_cloves_512/)
β”œβ”€β”€ single_clove/
β”‚   β”œβ”€β”€ grade_I/              # 1,084 images
β”‚   β”œβ”€β”€ grade_II/             # 1,050 images
β”‚   β”œβ”€β”€ grade_III/            # 1,503 images
β”‚   └── grade_IV/             #   966 images
└── batch/
    β”œβ”€β”€ grade_I/              # 150 images
    β”œβ”€β”€ grade_II/             # 150 images
    β”œβ”€β”€ grade_III/            # 150 images
    └── grade_IV/             # 150 images

There are no predefined train/val/test splits β€” images are provided flat by grade so researchers can apply their own partitioning strategy. The authors used stratified 70/15/15 splits in the original study.


Image Details

Single-clove images show one isolated clove per image against a neutral background, captured under natural ambient warehouse light (Phase 1) or a controlled LED lightbox (Phase 3). They are suitable for classification, feature extraction, and fine-grained grade discrimination tasks.

Batch pile images show kilogram-scale piles of mixed cloves as photographed at ZSTC intake sessions, reflecting real-world field conditions including lighting variation, clove overlap, and minor debris. They are suitable for batch-level classification, instance segmentation, and grading pipeline research.


Data Collection

Images were collected across two phases at the ZSTC Saateni Warehouse, Unguja, Zanzibar:

  • Phase 1 β€” Handheld capture at ~30 cm above a matte white sheet under natural ambient warehouse light. No flash or post-capture enhancement applied.
  • Phase 3 β€” Controlled setup using a PULUZ 30 cm Γ— 30 cm LED lightbox, JMARY mobile holder, and K&F Concept tripod for consistent diffuse illumination.

All grade labels were assigned by consensus among three ZSTC-certified inspectors examining the physical clove samples directly. Labels were not assigned from the images alone.


Intended Uses

This dataset is intended for research in:

  • Fine-grained agricultural image classification β€” distinguishing subtle visual quality differences across grades
  • Instance segmentation for batch grading β€” isolating individual cloves in pile images for per-instance quality assessment
  • Decomposed / procedural grading pipelines β€” systems that mirror the multi-step logic of official grading standards rather than treating grading as a single-shot classification task
  • Edge deployment benchmarking β€” evaluating model accuracy vs. size trade-offs for mobile agricultural AI

Companion Resources

Resource Link
Source code & trained models github.com/PatrickIIT/zanzibar-clove-grading-cv
224 Γ— 224 dataset This repository
512 Γ— 512 dataset This repository

About

This dataset was constructed as part of an MTech thesis at the IIT Madras Zanzibar Campus (School of Engineering and Science), supervised by Dr. Innocent Nyalala. The work proposes a Decomposed Multi-Task Vision framework for auditable agricultural grading, structurally aligned with the ZSTC's official procedural grading standards.

For questions about the dataset, please open an issue on the companion GitHub repository.

Downloads last month
10