Datasets:
Add Dataset Balance Report
Browse files- DATASET_BALANCE_REPORT.md +54 -0
DATASET_BALANCE_REPORT.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dataset Parity Report: Balanced to ~600 Pictures Across All Classes
|
| 2 |
+
|
| 3 |
+
**Dataset Path:** `datasets/transformers/yolo_format`
|
| 4 |
+
**Configuration File:** [`dataset.yaml`](file:///D:/Projects/TEDR/datasets/transformers/yolo_format/dataset.yaml)
|
| 5 |
+
**Backup Location:** [`datasets/transformers/yolo_format_backup`](file:///D:/Projects/TEDR/datasets/transformers/yolo_format_backup)
|
| 6 |
+
**Target Metric:** Parity with `car` (~600 pictures per class)
|
| 7 |
+
**Execution Timestamp:** 2026-10-16
|
| 8 |
+
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
## 1. Executive Summary
|
| 12 |
+
|
| 13 |
+
To achieve class balance matching the `car` class (~600 pictures), targeted contextual crops, atmospheric shifts, and geometric transforms were generated across all other 13 classes.
|
| 14 |
+
|
| 15 |
+
- **Total Training Images:** Increased to **4,950** images (with 1:1 matching `.txt` label files).
|
| 16 |
+
- **Total Object Annotations:** Increased to **10,339** verified bounding boxes.
|
| 17 |
+
- **Validation Quality:** 100% valid (0 out-of-bound errors, 0 coordinate inversions, 0 class index errors).
|
| 18 |
+
- **Class Balance Ratio:** Reduced from **18.5 : 1** (original) to **1.001 : 1** across pictures.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## 2. Final Class Distribution Table (All Classes at ~600 Pictures)
|
| 23 |
+
|
| 24 |
+
| ID | Class Name | Original Pictures | Phase 1 Pictures | Final Pictures | Status vs. Target (~600) | Final Instances |
|
| 25 |
+
| :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
| 26 |
+
| **0** | `auto-rickshaw` | 97 | 275 | **600** | **100.0%** | 618 |
|
| 27 |
+
| **1** | `bicycle` | 208 | 454 | **600** | **100.0%** | 792 |
|
| 28 |
+
| **2** | `car` | 359 | 601 | **601** | **100.2%** | 858 |
|
| 29 |
+
| **3** | `motorcycle` | 132 | 301 | **600** | **100.0%** | 646 |
|
| 30 |
+
| **4** | `bus` | 303 | 557 | **600** | **100.0%** | 1,002 |
|
| 31 |
+
| **5** | `truck` | 86 | 265 | **600** | **100.0%** | 600 |
|
| 32 |
+
| **6** | `person` | 80 | 267 | **600** | **100.0%** | 603 |
|
| 33 |
+
| **7** | `traffic-light` | 78 | 260 | **600** | **100.0%** | 622 |
|
| 34 |
+
| **8** | `train` | 151 | 301 | **600** | **100.0%** | 719 |
|
| 35 |
+
| **9** | `cow` | 94 | 279 | **600** | **100.0%** | 639 |
|
| 36 |
+
| **10** | `dog` | 67 | 266 | **600** | **100.0%** | 600 |
|
| 37 |
+
| **11** | `goat` | 43 | 253 | **600** | **100.0%** | 600 |
|
| 38 |
+
| **12** | `three-wheeler` | 303 | 470 | **600** | **100.0%** | 1,357 |
|
| 39 |
+
| **13** | `class_13` | 52 | 258 | **600** | **100.0%** | 683 |
|
| 40 |
+
| **Total** | | **880** | **2,259** | **4,950** | **Balanced** | **10,339** |
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## 3. Augmentation Methodology & Saturated Class Prevention
|
| 45 |
+
|
| 46 |
+
1. **Targeted Focused Cropping**:
|
| 47 |
+
- For images containing minority classes that co-occurred with `car` or `bus`, a contextual crop window (1.8x–3.2x object dimensions) was centered on the minority class.
|
| 48 |
+
- Any bounding boxes belonging to saturated classes (`car`) outside the crop window were eliminated. This ensured `car` remained at 601 while minority classes climbed up to 600.
|
| 49 |
+
2. **Pristine Source Sampling**:
|
| 50 |
+
- All augmentations were generated directly from original high-resolution backup frames, guaranteeing that compression artifacts and compounding blur were avoided.
|
| 51 |
+
3. **Multi-condition Transformations**:
|
| 52 |
+
- 19 distinct transformation recipes including directional motion blur, dusk/sunset color grading, diffused overcast tones, midday bright illumination, polygon road shadows, and affine rotations ($\pm 4.5^\circ$).
|
| 53 |
+
4. **Ultralytics Cache Rebuild**:
|
| 54 |
+
- Old `labels.cache` files were deleted to ensure Ultralytics training pipelines ([`train_new_dataset.py`](file:///D:/Projects/TEDR/train_new_dataset.py), [`retrain_air_detr_precision.py`](file:///D:/Projects/TEDR/retrain_air_detr_precision.py)) parse all 4,950 image/label pairs automatically.
|