aryala77 commited on
Commit
1499be5
·
verified ·
1 Parent(s): 1c37ecf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +330 -0
README.md CHANGED
@@ -44,4 +44,334 @@ tags:
44
  pretty_name: Wild Trash Inference Dataset
45
  task_categories:
46
  - image-classification
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  ---
 
44
  pretty_name: Wild Trash Inference Dataset
45
  task_categories:
46
  - image-classification
47
+ ---
48
+
49
+ # Wild Trash Inference Dataset
50
+
51
+ The **Wild Trash Inference Dataset** is a custom image dataset created by the TrashBusters project for evaluating waste-classification models under realistic outdoor conditions.
52
+
53
+ Unlike many public waste datasets, which contain centered objects, clean backgrounds, or controlled lighting, this dataset contains waste objects photographed in natural environments. The images include variations in background, lighting, camera angle, object size, object position, and partial occlusion.
54
+
55
+ The dataset is intended primarily as an **external inference and robustness evaluation dataset**, rather than as a model-training dataset.
56
+
57
+ * **Repository:** `TrashBusters/wild-trash-inference-dataset`
58
+ * **Task:** Multi-class image classification
59
+ * **Number of classes:** 6
60
+ * **Number of images:** Approximately 350
61
+ * **Language:** Not applicable
62
+ * **Primary use:** Evaluation under domain shift
63
+
64
+ ## Dataset Motivation
65
+
66
+ The public datasets used to train the TrashBusters models contain images collected from different sources and under different visual conditions. However, many images still present waste objects in relatively clean or recognizable settings.
67
+
68
+ A model that performs well on a conventional held-out test set may not necessarily generalize to waste encountered outdoors. Models may rely on background patterns, object placement, lighting conditions, or dataset-specific visual cues instead of learning the actual characteristics of the waste objects.
69
+
70
+ This custom dataset was therefore created to answer the following question:
71
+
72
+ > Can models trained on public waste datasets correctly classify waste objects photographed in realistic outdoor environments?
73
+
74
+ The dataset introduces a deliberate domain shift between the training data and the final evaluation data.
75
+
76
+ ## Dataset Content
77
+
78
+ The dataset uses the same six-class label structure as the main TrashBusters training dataset:
79
+
80
+ | Label | Description |
81
+ | ----------- | --------------------------------------------------------------------------------- |
82
+ | `cardboard` | Cardboard packaging, boxes, and related cardboard objects |
83
+ | `glass` | Glass bottles, containers, and broken glass objects |
84
+ | `metal` | Metal cans, containers, and other metallic waste |
85
+ | `paper` | Paper sheets, paper packaging, and similar paper waste |
86
+ | `plastic` | Plastic bottles, packaging, cups, and other plastic objects |
87
+ | `trash` | Waste that does not clearly belong to one of the five recyclable material classes |
88
+
89
+ The `trash` class functions as a broad residual category. It can therefore contain greater visual variation than the other classes.
90
+
91
+ ## Data Collection
92
+
93
+ The images were collected manually by members of the TrashBusters project in an outdoor park environment.
94
+
95
+ Waste objects were photographed under naturally occurring conditions rather than in a controlled photography setup. The images include differences in:
96
+
97
+ * Natural backgrounds such as grass, soil, leaves, and pavement
98
+ * Lighting and shadows
99
+ * Camera distance and viewing angle
100
+ * Object orientation
101
+ * Object scale within the image
102
+ * Background clutter
103
+ * Partial object occlusion
104
+ * Object condition, including deformation, dirt, and damage
105
+
106
+ These characteristics make the dataset more representative of a real-world waste-recognition scenario.
107
+
108
+ ## Dataset Structure
109
+
110
+ Each sample contains an image and its corresponding waste category.
111
+
112
+ A dataset entry may have a structure similar to the following:
113
+
114
+ ```python
115
+ {
116
+ "image": <PIL.Image.Image>,
117
+ "label": 4,
118
+ "label_name": "plastic"
119
+ }
120
+ ```
121
+
122
+ Depending on the published dataset configuration, additional metadata fields may also be available.
123
+
124
+ ### Example Fields
125
+
126
+ | Field | Type | Description |
127
+ | ------------ | --------------------- | ---------------------------- |
128
+ | `image` | Image | The waste image |
129
+ | `label` | ClassLabel or integer | Encoded class identifier |
130
+ | `label_name` | String | Human-readable category name |
131
+
132
+ ## Loading the Dataset
133
+
134
+ The dataset can be loaded using the Hugging Face `datasets` library:
135
+
136
+ ```python
137
+ from datasets import load_dataset
138
+
139
+ dataset = load_dataset(
140
+ "TrashBusters/wild-trash-inference-dataset"
141
+ )
142
+
143
+ print(dataset)
144
+ print(dataset["train"][0])
145
+ ```
146
+
147
+ The available split name should be checked after loading:
148
+
149
+ ```python
150
+ print(dataset.keys())
151
+ ```
152
+
153
+ To display an example:
154
+
155
+ ```python
156
+ sample = dataset["train"][0]
157
+
158
+ print(sample["label"])
159
+ print(sample.get("label_name"))
160
+
161
+ sample["image"].show()
162
+ ```
163
+
164
+ ## Intended Uses
165
+
166
+ The dataset is intended for:
167
+
168
+ * External evaluation of waste-classification models
169
+ * Domain-shift evaluation
170
+ * Out-of-distribution robustness analysis
171
+ * Comparison of CNN, transformer, and MLP-based image classifiers
172
+ * Error analysis
173
+ * Explainable AI analysis
174
+ * Investigation of background bias
175
+ * Evaluation of real-world generalization
176
+
177
+ The dataset was used in the TrashBusters project to evaluate the following model architectures:
178
+
179
+ * ResNet-18
180
+ * ConvNeXt-Tiny
181
+ * DeiT
182
+ * MLP-Mixer
183
+
184
+ It was also used together with explainability methods such as:
185
+
186
+ * Grad-CAM
187
+ * Occlusion sensitivity
188
+ * Integrated Gradients
189
+
190
+ These methods helped investigate whether the models focused on the waste object itself or on irrelevant environmental features such as grass and surrounding vegetation.
191
+
192
+ ## Recommended Evaluation
193
+
194
+ Because this dataset is intended for evaluation rather than training, results should be reported separately from results obtained on the standard test split of the training dataset.
195
+
196
+ Recommended metrics include:
197
+
198
+ * Overall accuracy
199
+ * Macro-averaged precision
200
+ * Macro-averaged recall
201
+ * Macro-averaged F1-score
202
+ * Per-class precision
203
+ * Per-class recall
204
+ * Per-class F1-score
205
+ * Confusion matrix
206
+
207
+ Macro-averaged metrics are particularly important because the custom dataset is not necessarily balanced across all six classes.
208
+
209
+ Example evaluation:
210
+
211
+ ```python
212
+ import evaluate
213
+ import numpy as np
214
+
215
+ accuracy_metric = evaluate.load("accuracy")
216
+ f1_metric = evaluate.load("f1")
217
+
218
+ predictions = np.asarray(predictions)
219
+ references = np.asarray(references)
220
+
221
+ accuracy = accuracy_metric.compute(
222
+ predictions=predictions,
223
+ references=references,
224
+ )
225
+
226
+ macro_f1 = f1_metric.compute(
227
+ predictions=predictions,
228
+ references=references,
229
+ average="macro",
230
+ )
231
+
232
+ print(accuracy)
233
+ print(macro_f1)
234
+ ```
235
+
236
+ ## Class Imbalance
237
+
238
+ The class distribution reflects the waste objects that were available during data collection. Consequently, the dataset may contain different numbers of examples for each category.
239
+
240
+ This imbalance is acceptable for the intended use because the dataset serves as an external real-world evaluation set rather than as a balanced training set.
241
+
242
+ However, users should avoid relying only on overall accuracy. Macro-averaged and per-class metrics should also be reported so that results are not dominated by classes containing more images.
243
+
244
+ The class distribution should not be artificially balanced through duplication or oversampling during evaluation.
245
+
246
+ ## Domain Shift
247
+
248
+ The dataset differs from the main TrashBusters training dataset in several ways:
249
+
250
+ | Aspect | Training dataset | Wild inference dataset |
251
+ | ---------------- | ------------------------------------------ | ------------------------------------------ |
252
+ | Data source | Combined public datasets | Custom manual collection |
253
+ | Environment | Mixed controlled and real-world settings | Outdoor natural environment |
254
+ | Background | Often clean or dataset-specific | Grass, leaves, soil, pavement, and clutter |
255
+ | Object placement | Frequently centered and clearly visible | Variable position and scale |
256
+ | Lighting | Dataset-dependent | Natural and variable |
257
+ | Intended purpose | Training, validation, and standard testing | External robustness evaluation |
258
+
259
+ The performance difference between the standard test dataset and this dataset can be interpreted as an indication of the model’s sensitivity to domain shift.
260
+
261
+ However, it should not be treated as a universal measure of real-world waste-classification performance because the dataset represents only a limited set of locations and environmental conditions.
262
+
263
+ ## Data Quality
264
+
265
+ The images were manually collected and labelled according to the six TrashBusters categories.
266
+
267
+ Potential sources of ambiguity include:
268
+
269
+ * Objects composed of multiple materials
270
+ * Dirty or damaged objects
271
+ * Partially visible objects
272
+ * Transparent objects
273
+ * Crushed packaging
274
+ * Objects whose material cannot be determined reliably from appearance alone
275
+ * Items that could reasonably fit both a recyclable class and the general `trash` class
276
+
277
+ The labels represent the annotators’ best visual assessment of the primary material or appropriate residual category.
278
+
279
+ ## Limitations
280
+
281
+ The dataset has several limitations:
282
+
283
+ 1. **Small dataset size**
284
+
285
+ The dataset contains only approximately 350 images. Results may therefore vary considerably between classes, particularly for classes with few examples.
286
+
287
+ 2. **Limited geographic coverage**
288
+
289
+ The images were collected in a limited outdoor area and may not represent waste encountered in other cities, countries, climates, or seasons.
290
+
291
+ 3. **Class imbalance**
292
+
293
+ The dataset was collected naturally and was not designed to contain an equal number of examples for every class.
294
+
295
+ 4. **Single-label formulation**
296
+
297
+ Some waste objects contain several materials, but each image receives only one class label.
298
+
299
+ 5. **Broad `trash` category**
300
+
301
+ The `trash` class contains visually diverse objects and may be more difficult to classify consistently.
302
+
303
+ 6. **Material ambiguity**
304
+
305
+ An object’s material cannot always be determined accurately from an image alone.
306
+
307
+ 7. **Not a detection dataset**
308
+
309
+ The dataset provides image-level classification labels and does not provide object bounding boxes or segmentation masks.
310
+
311
+ 8. **Environmental coverage**
312
+
313
+ Although the dataset introduces an outdoor domain shift, it does not cover every real-world condition, such as snow, heavy rain, nighttime scenes, industrial waste, beaches, or underwater environments.
314
+
315
+ ## Out-of-Scope Uses
316
+
317
+ The dataset is not designed for:
318
+
319
+ * Training production-ready waste-management systems by itself
320
+ * Hazardous-waste identification
321
+ * Medical-waste classification
322
+ * Chemical identification
323
+ * Automated recycling decisions without human supervision
324
+ * Object detection or semantic segmentation
325
+ * Estimating whether an object is legally recyclable in a particular municipality
326
+ * Evaluating all possible real-world waste environments
327
+
328
+ Recycling rules can differ by region. The dataset labels describe broad visual material categories and should not be interpreted as local disposal instructions.
329
+
330
+ ## Ethical Considerations
331
+
332
+ The dataset focuses on discarded objects and natural backgrounds. Images should be reviewed before publication to ensure that they do not contain identifiable people, private information, vehicle registration plates, or other sensitive visual information.
333
+
334
+ Models evaluated on this dataset may still learn undesirable correlations between waste classes and environmental features. Explainability methods and error analysis are recommended before applying such models in real-world systems.
335
+
336
+ ## Relationship to the Main TrashBusters Dataset
337
+
338
+ The models evaluated with this dataset were trained using a harmonized dataset constructed from four public waste-classification datasets:
339
+
340
+ * TrashNet
341
+ * Recyclable and Household Waste Classification
342
+ * Garbage Classification V2
343
+ * TriCascade Waste Datasets
344
+
345
+ The harmonized training dataset uses the same six output classes as this custom evaluation dataset.
346
+
347
+ Keeping the custom images separate from the training dataset prevents evaluation leakage and provides a more realistic estimate of model generalization to previously unseen data sources and environments.
348
+
349
+ ## Dataset Creation Team
350
+
351
+ The dataset was created as part of the **TrashBusters** machine-learning project.
352
+
353
+ ## Licensing
354
+
355
+ A license has not been specified in this dataset card.
356
+
357
+ Before redistributing or using the dataset outside research or educational contexts, users should check the license information provided in the Hugging Face repository and confirm that the collected images can be used for the intended purpose.
358
+
359
+ ## Citation
360
+
361
+ When using this dataset, please cite the TrashBusters project and reference the Hugging Face repository:
362
+
363
+ ```bibtex
364
+ @misc{trashbusters_wild_trash_inference_dataset,
365
+ title = {Wild Trash Inference Dataset},
366
+ author = {{TrashBusters}},
367
+ year = {2026},
368
+ howpublished = {\url{https://huggingface.co/datasets/TrashBusters/wild-trash-inference-dataset}},
369
+ note = {Custom outdoor dataset for domain-shift evaluation of waste-classification models}
370
+ }
371
+ ```
372
+
373
+ ## Acknowledgements
374
+
375
+ The dataset was created to support research into robust and explainable waste classification, with a particular focus on performance degradation caused by real-world environmental changes.
376
+
377
  ---