Datasets:
File size: 12,119 Bytes
04673d1 2fd6214 04673d1 2fd6214 04673d1 2fd6214 04673d1 952faf5 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 8c6e922 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 99adf1d 1c246f5 | 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 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | ---
dataset_info:
features:
- name: image
dtype: image
- name: label
dtype:
class_label:
names:
'0': cardboard
'1': glass
'2': metal
'3': paper
'4': plastic
'5': trash
- name: label_id
dtype: int64
- name: label_name
dtype: string
- name: source_dataset
dtype: string
- name: original_label
dtype: string
- name: image_context
dtype: string
splits:
- name: train
num_bytes: 1450173709
num_examples: 20894
- name: validation
num_bytes: 282857438
num_examples: 4477
- name: test
num_bytes: 279046679
num_examples: 4478
download_size: 2068691097
dataset_size: 2012077826
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: validation
path: data/validation-*
- split: test
path: data/test-*
license: mit
task_categories:
- image-classification
language:
- en
tags:
- waste-classification
- trash-classification
- image-classification
size_categories:
- 1K<n<10K
---
# Dataset Card for Waste Classification Harmonized Dataset
## Dataset Details
### Dataset Description
This dataset is a harmonized image classification dataset for waste classification. It combines multiple waste-related image datasets into a unified label structure with six target classes:
* `cardboard`
* `glass`
* `metal`
* `paper`
* `plastic`
* `trash`
The dataset is designed for training and evaluating computer vision models for waste classification, especially in the context of recycling and real-world trash recognition. The original datasets used different label names and different levels of class granularity, so their labels were mapped into one common classification scheme.
The final dataset contains **29,849 images**.
* **License:** MIT
### Dataset Sources
This project combines and harmonizes the following public waste-classification datasets:
#### TrashNet
* **Source:** Kaggle — TrashNet by Feyza Ozkefe
* **Link:** https://www.kaggle.com/datasets/feyzazkefe/trashnet
* **Notes:** Contains six TrashNet-style classes: `cardboard`, `glass`, `metal`, `paper`, `plastic`, and `trash`.
* **Used for:** Base label structure and additional image data.
* **License:** MIT
#### Household Garbage Dataset
* **Source:** Kaggle — Recyclable and Household Waste Classification
* **Link:** https://www.kaggle.com/datasets/alistairking/recyclable-and-household-waste-classification/data
* **Notes:** Contains household garbage classes with `default` and `real_world` image contexts.
* **Used for:** Additional training data and real-world robustness evaluation.
* **License:** MIT
#### The Garbage Dataset / Garbage Classification V2
* **Source:** Kaggle — Garbage Classification V2
* **Link:** https://www.kaggle.com/datasets/sumn2u/garbage-classification-v2
* **Notes:** Only the `original` folder was used. The `standardized_256` and `standardized_384` folders were ignored to avoid duplicate or near-duplicate images.
* **Used for:** Additional training data after label harmonization.
* **License:** MIT
#### TriCascade WasteImage
* **Source:** Kaggle — TriCascade WasteImage Dataset
* **Link:** https://www.kaggle.com/datasets/salam035/waste-datasets
* **Used for:** Additional training data after label harmonization.
* **License:** MIT
## Uses
### Direct Use
This dataset can be used for:
* image classification
* waste classification
* recycling-related computer vision experiments
* transfer learning
* fine-tuning pretrained vision models
* comparing image classification architectures
* evaluating model robustness across different image sources
Suitable model architectures include, but are not limited to:
* ResNet
* ConvNeXt
* DeiT
* EfficientNet
* MLP-Mixer
* Vision Transformer variants
### Out-of-Scope Use
This dataset is not intended for direct deployment in production-level recycling systems without further validation.
The dataset should not be used as the only evaluation source for real-world waste sorting systems, because real-world environments may include:
* multiple objects in one image
* damaged or dirty waste objects
* unusual lighting conditions
* occlusion
* mixed materials
* unseen waste categories
* local recycling rules that differ by region
The dataset is also not suitable for fine-grained waste classification such as distinguishing between PET, HDPE, organic waste, batteries, electronic waste, or hazardous materials.
## Dataset Structure
Each sample contains an image, a harmonized label, and metadata about the original source.
Example sample:
```python
{
"image": "<PIL.Image.Image>",
"label": 4,
"label_id": 4,
"label_name": "plastic",
"source_dataset": "household_garbage",
"original_label": "plastic_soda_bottles",
"image_context": "real_world"
}
```
### Fields
| Field | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------- |
| `image` | Image file loaded as a Hugging Face image feature |
| `label` | Integer class label used for training |
| `label_id` | Integer ID of the harmonized label |
| `label_name` | Name of the harmonized class |
| `source_dataset` | Name of the dataset from which the image originated |
| `original_label` | Original label before harmonization |
| `image_context` | Context information about the image, for example `real_world`, `default`, or source-specific context |
### Label Mapping
| Label ID | Label Name |
| -------: | ---------- |
| 0 | cardboard |
| 1 | glass |
| 2 | metal |
| 3 | paper |
| 4 | plastic |
| 5 | trash |
### Label Distribution
The final harmonized dataset contains **29,849 images** across six classes.
| Label | Count |
| --------- | ----: |
| cardboard | 4,849 |
| glass | 5,000 |
| metal | 5,000 |
| paper | 5,000 |
| plastic | 5,000 |
| trash | 5,000 |
Most classes were limited to **5,000 images per label** to reduce class imbalance. The `cardboard` class contains **4,849 images**, because fewer images were available after harmonization and filtering.
### Data Splits
| Split | Number of Images |
| ---------- | ---------------: |
| train | 20,894 |
| validation | 4,477 |
| test | 4,478 |
Total: **29,849 images**
## Dataset Creation
### Curation Rationale
Waste classification datasets often use different class names, different label granularities, and different image conditions. For example, one dataset may use a broad label such as `plastic`, while another may contain more specific labels such as `plastic_soda_bottles`, `plastic_food_containers`, or `plastic_cup_lids`.
The goal of this dataset is to create a unified and practical waste-classification dataset with a common label structure. This makes it easier to train and compare different image classification models under the same classification task.
### Source Data
The source data consists of waste images from multiple public Kaggle datasets. These datasets contain images of recyclable and non-recyclable waste objects, including cardboard, glass, metal, paper, plastic, and general trash.
The original datasets use different label names, image contexts, and levels of class granularity. Therefore, their labels were mapped into one shared six-class structure:
* `cardboard`
* `glass`
* `metal`
* `paper`
* `plastic`
* `trash`
The original dataset name and original label are preserved in the metadata fields `source_dataset` and `original_label`.
### Annotations
The dataset does not introduce completely new manual annotations for every image. Instead, it harmonizes existing source labels into a shared six-class label structure.
#### Annotation Process
The annotation process consisted mainly of label harmonization. Source-specific labels were mapped to one of the following final classes:
* `cardboard`
* `glass`
* `metal`
* `paper`
* `plastic`
* `trash`
For example:
* `plastic_soda_bottles` → `plastic`
* `plastic_food_containers` → `plastic`
* `plastic_cup_lids` → `plastic`
The original labels are preserved in the dataset metadata.
#### Who are the annotators?
The original annotations were provided by the creators of the source datasets. The harmonized label mapping was created during the dataset preparation process.
#### Personal and Sensitive Information
This dataset contains images of waste objects. It is not intended to contain personal, sensitive, or private information.
However, because the dataset contains real-world images from multiple sources, there is a possibility that some images may include background objects or environmental details. Users should inspect the dataset before using it in privacy-sensitive applications.
## Bias, Risks, and Limitations
This dataset has several limitations:
1. **Source bias**
The dataset combines images from different sources. Each source may have different image styles, backgrounds, camera qualities, object positions, and lighting conditions.
2. **Background bias**
Some images may contain clean or artificial backgrounds, while others may contain more realistic environments. A model trained on this dataset may learn background patterns instead of only learning the waste object.
3. **Label noise**
Some images may contain multiple objects, unclear objects, damaged waste items, or objects made of mixed materials. In such cases, a single label may not fully describe the image.
4. **Limited taxonomy**
The dataset only contains six broad classes. It does not distinguish between more specific waste categories such as organic waste, batteries, electronics, hazardous materials, or different plastic types.
5. **Near-duplicate images**
Since the dataset was created from multiple sources, there may be duplicate or near-duplicate images. Users should perform duplicate detection if they need a strict evaluation setup.
6. **Real-world generalization**
Good performance on this dataset does not guarantee good performance in real recycling facilities or outdoor waste-detection scenarios.
### Recommendations
Users should evaluate models with more than accuracy alone. Recommended metrics include:
* macro F1-score
* per-class precision
* per-class recall
* confusion matrix
* validation loss
* test loss
Macro F1-score is especially recommended because each waste class should be treated equally.
For stronger evaluation, users should consider source-aware testing. For example, they can train on some source datasets and test on a different source dataset to measure domain generalization.
**APA:**
Lavassani, A. (2026). *Waste Classification Harmonized Dataset*. Hugging Face.
## Glossary
**Harmonization**
The process of mapping labels from different datasets into one shared label structure.
**Source dataset**
The original dataset from which an image was taken.
**Original label**
The label assigned to the image in its original dataset before harmonization.
**Image context**
Metadata describing the visual context or source-specific image condition, such as real-world or default images.
**Macro F1-score**
An evaluation metric that calculates the F1-score for each class separately and then averages them equally. This is useful when all classes are important.
## More Information
This dataset was created as part of a machine learning project for waste image classification. The project focuses on dataset harmonization, model comparison, transfer learning, and fine-tuning pretrained computer vision models.
|