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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
license: mit
|
| 4 |
+
task_categories:
|
| 5 |
+
- object-detection
|
| 6 |
+
- image-segmentation
|
| 7 |
+
- feature-extraction
|
| 8 |
+
- zero-shot-classification
|
| 9 |
+
tags:
|
| 10 |
+
- agriculture
|
| 11 |
+
- coffee
|
| 12 |
+
- food-quality
|
| 13 |
+
- commodity-grading
|
| 14 |
+
pretty_name: Pre-Roast Arabica Coffee Bean Grading Dataset
|
| 15 |
+
size_categories:
|
| 16 |
+
- 1K<n<10K
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# A Image Dataset of Pre-Roast Arabica Coffee Beans with Polygon Annotations for Automated Grading
|
| 20 |
+
|
| 21 |
+
## Abstract
|
| 22 |
+
Automated quality assessment of raw agricultural products is critical for ensuring fair trade and supply chain efficiency. This dataset presents **3,877 high-resolution images** of *pre-roast Arabica coffee beans*, collected from farms in **Coorg, Karnataka (India)**—a major coffee-producing region. Each bean is categorized into one of four quality grades:
|
| 23 |
+
|
| 24 |
+
| Grade | Description |
|
| 25 |
+
|-------|-------------|
|
| 26 |
+
| A | Premium |
|
| 27 |
+
| B | Good |
|
| 28 |
+
| C | Standard |
|
| 29 |
+
| D | Defective |
|
| 30 |
+
|
| 31 |
+
A total of **2,284 beans** are annotated using **polygon masks** and grade labels in **LabelMe JSON format**, supporting research in **classification, instance segmentation, automated grading, and defect detection**. A YOLOv11 multi-class instance segmentation baseline was trained to validate annotation quality and demonstrate practical model performance.
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## Dataset Structure
|
| 36 |
+
|
| 37 |
+
```text
|
| 38 |
+
/
|
| 39 |
+
├── CGA/ # Grade A (Premium)
|
| 40 |
+
│ ├── CGA_images/
|
| 41 |
+
│ └── CGA_json/
|
| 42 |
+
├── CGB/ # Grade B (Good)
|
| 43 |
+
├── CGC/ # Grade C (Standard)
|
| 44 |
+
└── CGD/ # Grade D (Defective)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
### Distribution Summary
|
| 49 |
+
|
| 50 |
+
| Grade | Quality | Images | Polygon Annotations |
|
| 51 |
+
|-------|---------|--------|---------------------|
|
| 52 |
+
| A | Premium | 1000 | 600 |
|
| 53 |
+
| B | Good | 1000 | 600 |
|
| 54 |
+
| C | Standard | 1002 | 487 |
|
| 55 |
+
| D | Defective | 875 | 597 |
|
| 56 |
+
| **Total** | — | **3,877** | **2,284** |
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
## Data Collection and Annotation
|
| 61 |
+
|
| 62 |
+
| Attribute | Details |
|
| 63 |
+
|----------|---------|
|
| 64 |
+
| Coffee Variety | *Coffea arabica* |
|
| 65 |
+
| Region | Coorg (Kodagu), Karnataka, India |
|
| 66 |
+
| Imaging Setup | Controlled indoor lighting with a white backdrop |
|
| 67 |
+
| Devices Used | iPhone 15 Pro, Samsung 2023/24 models, Google Pixel 7, Poco X Series |
|
| 68 |
+
| Annotation Tool | LabelMe (Polygon Mode) |
|
| 69 |
+
| Data Format | `.jpg` images + `.json` polygon annotation files |
|
| 70 |
+
|
| 71 |
+
Each annotation file contains:
|
| 72 |
+
* `"label": "grade_a" | "grade_b" | "grade_c" | "grade_d"`
|
| 73 |
+
* `"points": [ [x1,y1], [x2,y2], ... ]`
|
| 74 |
+
|
| 75 |
+
Annotations were reviewed by trained annotators to ensure precision.
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## Recommended Use Cases
|
| 80 |
+
|
| 81 |
+
- Multi-class instance segmentation training
|
| 82 |
+
- Automated grading and sorting systems
|
| 83 |
+
- Agricultural defect detection research
|
| 84 |
+
- Food quality assurance studies
|
| 85 |
+
- Robust low-cost supply chain inspection systems
|
| 86 |
+
|
| 87 |
+
### Out-of-Scope Use
|
| 88 |
+
- Personal identification
|
| 89 |
+
- Medical or biometric inference (dataset contains **no personal data**)
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
+
|
| 93 |
+
## Baseline Experiment (YOLOv11 Segmentation)
|
| 94 |
+
|
| 95 |
+
To validate the dataset's quality and visual separability, a baseline instance segmentation model (YOLOv11) was trained. The model was trained for 150 epochs, with the best-performing checkpoint saved for evaluation.
|
| 96 |
+
|
| 97 |
+
The results confirm that the dataset supports strong performance for automated grading, achieving a mean Average Precision (mAP) of **0.93** for object detection and **0.91** for instance segmentation.
|
| 98 |
+
|
| 99 |
+
### Final Metrics (from `best.pt` model)
|
| 100 |
+
|
| 101 |
+
| Metric | Grade A | Grade B | Grade C | Grade D | Mean (All Classes) |
|
| 102 |
+
|:-------|:--------:|:--------:|:--------:|:--------:|:------:|
|
| 103 |
+
| **Box mAP@0.5** | 0.94 | 0.90 | 0.91 | 0.97 | **0.93** |
|
| 104 |
+
| **Mask mAP@0.5** | 0.92 | 0.88 | 0.88 | 0.96 | **0.91** |
|
| 105 |
+
|
| 106 |
+
> **Note:** The high precision on Grade D (Defective) is particularly valuable, as it demonstrates the model's reliability in identifying and sorting out low-quality beans, which is a primary goal of automated grading systems.
|
| 107 |
+
|
| 108 |
+
---
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
## How to Use
|
| 112 |
+
|
| 113 |
+
### Load JSON Annotation Example
|
| 114 |
+
```python
|
| 115 |
+
import json
|
| 116 |
+
import glob
|
| 117 |
+
|
| 118 |
+
# Example for Grade A
|
| 119 |
+
files = glob.glob("CGA/CGA_json/*.json")
|
| 120 |
+
with open(files[0], "r") as f:
|
| 121 |
+
ann = json.load(f)
|
| 122 |
+
|
| 123 |
+
print(ann["shapes"][0]["points"]) # Polygon coordinates
|
| 124 |
+
print(ann["shapes"][0]["label"]) # Grade label
|
| 125 |
+
````
|
| 126 |
+
|
| 127 |
+
## Value of the Dataset
|
| 128 |
+
|
| 129 |
+
* First publicly available polygon-annotated dataset of pre-roast coffee beans.
|
| 130 |
+
* Enables end-to-end automated grading using segmentation + classification.
|
| 131 |
+
* Facilitates fair pricing and quality transparency in the coffee supply chain.
|
| 132 |
+
* Robust for deployment in low-cost rural environments using consumer smartphones.
|
| 133 |
+
|
| 134 |
+
## Contributors
|
| 135 |
+
|
| 136 |
+
| Name | ORCID | Role |
|
| 137 |
+
|---|---|---|
|
| 138 |
+
| Samruddh K | 0009-0008-3588-9272 | Research, Dataset Preparation & Documentation |
|
| 139 |
+
| Abhay Varun S | 0009-0003-1299-724X | Research, Dataset Collection & Annotation |
|
| 140 |
+
| Bopanna K N | 0009-0008-0432-3196 | Annotation Support & Verification |
|
| 141 |
+
| H A Dheemanth Gowda | 0009-0001-1891-632X | Annotation Support & Verification |
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
## Citation
|
| 145 |
+
|
| 146 |
+
If you use this dataset, please cite:
|
| 147 |
+
|
| 148 |
+
@dataset{pre_roast_coffee_grading_2025,
|
| 149 |
+
title = {A Image Dataset of Pre-Roast Arabica Coffee Beans with Polygon Annotations for Automated Grading},
|
| 150 |
+
author = {Samruddh K and Bopanna K N and H A Dheemanth Gowda and Abhay Varun S},
|
| 151 |
+
year = {2025},
|
| 152 |
+
publisher = {Hugging Face Datasets},
|
| 153 |
+
license = {MIT},
|
| 154 |
+
url = {https://huggingface.co/datasets/SamruddhK/coffee-bean-grading-dataset}
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
## Contact
|
| 159 |
+
|
| 160 |
+
For questions, collaborations, or research use:
|
| 161 |
+
- Dataset Maintainer: **Samruddh K & Abhay Varun S**
|
| 162 |
+
- Hugging Face: https://huggingface.co/SamruddhK
|
| 163 |
+
- GitHub Samruddh K: https://github.com/SAMRUDDH15
|
| 164 |
+
- GitHub Abhay Varun S: https://github.com/abhay-error
|
| 165 |
+
* **Email:** [samruddh.k52@gmail.com & Abhayvarun618@gmail.com]
|
| 166 |
+
|
| 167 |
+
<!-- end list -->
|
| 168 |
+
|