Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- object-detection
|
| 5 |
+
- image-classification
|
| 6 |
+
- waste-classification
|
| 7 |
+
- hierarchical-classification
|
| 8 |
+
- yolov12
|
| 9 |
+
- computer-vision
|
| 10 |
+
- pytorch
|
| 11 |
+
language:
|
| 12 |
+
- id
|
| 13 |
+
- en
|
| 14 |
+
pipeline_tag: image-classification
|
| 15 |
+
datasets:
|
| 16 |
+
- afinnn/waste-detection-dataset
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# HSCN Waste Checkpoints - YOLOv12 + Hierarchical Sibling Classification Network (HSCN)
|
| 20 |
+
|
| 21 |
+
Repository ini berisi kumpulan **checkpoint model** untuk sistem deteksi dan klasifikasi sampah hierarkis dua tahap:
|
| 22 |
+
|
| 23 |
+
1. **YOLOv12** - mendeteksi objek sampah dalam gambar (bounding box).
|
| 24 |
+
2. **HSCN (Hierarchical Sibling Classification Network)** - mengklasifikasikan setiap objek hasil crop deteksi ke dalam **3 level hierarki**:
|
| 25 |
+
- **L1 - Waste Management**: kategori penanganan sampah (mis. daur ulang, organik, residu)
|
| 26 |
+
- **L2 - Material**: jenis material (mis. plastik, kertas, logam, kaca)
|
| 27 |
+
- **L3 - Specific Object**: kelas objek spesifik (mis. botol plastik, kaleng, kardus)
|
| 28 |
+
|
| 29 |
+
Model ini dikembangkan sebagai bagian dari penelitian tugas akhir/skripsi mengenai klasifikasi sampah berbasis computer vision, dan telah melalui proses sidang serta submission paper konferensi (SENTRIN).
|
| 30 |
+
|
| 31 |
+
## Struktur Repository
|
| 32 |
+
|
| 33 |
+
| Folder | Isi |
|
| 34 |
+
|---|---|
|
| 35 |
+
| `waste_detection_results` | Checkpoint & hasil training YOLOv12 (varian utama/default) |
|
| 36 |
+
| `waste_detection_results_yolol` | Checkpoint YOLOv12-**Large** |
|
| 37 |
+
| `waste_detection_results_yolom` | Checkpoint YOLOv12-**Medium** |
|
| 38 |
+
| `waste_detection_results_yolos` | Checkpoint YOLOv12-**Small** |
|
| 39 |
+
| `waste_hscn_results_convnext_small` | Checkpoint HSCN dengan backbone **ConvNeXt-Small** (backbone terbaik) |
|
| 40 |
+
| `waste_hscn_results_efficientnet_b3` | Checkpoint HSCN dengan backbone **EfficientNet-B3** |
|
| 41 |
+
| `waste_hscn_results_mobilenet_v3_large` | Checkpoint HSCN dengan backbone **MobileNetV3-Large** |
|
| 42 |
+
| `waste_hscn_results_resnet18` | Checkpoint HSCN dengan backbone **ResNet-18** |
|
| 43 |
+
| `waste_hscn_results_resnet50` | Checkpoint HSCN dengan backbone **ResNet-50** |
|
| 44 |
+
| `waste_hscn_results_resnet101` | Checkpoint HSCN dengan backbone **ResNet-101** |
|
| 45 |
+
|
| 46 |
+
## Dataset
|
| 47 |
+
|
| 48 |
+
- **6.357 objek crop** (hasil deteksi) digunakan untuk training klasifikasi HSCN
|
| 49 |
+
- **2.085 gambar** sebelum augmentasi digunakan untuk training deteksi YOLOv12
|
| 50 |
+
- Sumber dataset gabungan dari 4 dataset publik: **TrashNet, TACO, RealWaste**, dan **Kaggle** (waste classification dataset)
|
| 51 |
+
|
| 52 |
+
## Hasil Evaluasi
|
| 53 |
+
|
| 54 |
+
### Deteksi Objek - YOLOv12
|
| 55 |
+
Model terbaik: **YOLOv12-Large**
|
| 56 |
+
|
| 57 |
+
| Metrik | Skor |
|
| 58 |
+
|---|---|
|
| 59 |
+
| F1-Score | 0.844 |
|
| 60 |
+
| mAP@0.5:0.95 | 0.7636 |
|
| 61 |
+
|
| 62 |
+
### Klasifikasi Hierarkis - HSCN
|
| 63 |
+
6 backbone dievaluasi untuk mencari kombinasi terbaik. **ConvNeXt-Small** terpilih sebagai backbone terbaik:
|
| 64 |
+
|
| 65 |
+
| Backbone | mAP (mean, L1+L2+L3) | Akurasi L3 (kelas spesifik) |
|
| 66 |
+
|---|---|---|
|
| 67 |
+
| **ConvNeXt-Small** β | **0.967** | **0.5802** |
|
| 68 |
+
| ResNet-18 | β | β |
|
| 69 |
+
| ResNet-50 | β | β |
|
| 70 |
+
| ResNet-101 | β | β |
|
| 71 |
+
| EfficientNet-B3 | β | β |
|
| 72 |
+
| MobileNetV3-Large | β | β |
|
| 73 |
+
|
| 74 |
+
> Catatan: L3 (klasifikasi objek spesifik) merupakan level tersulit karena jumlah kelas yang lebih banyak dan granularitas visual yang tinggi antar sub-kategori material yang mirip.
|
| 75 |
+
|
| 76 |
+
## Cara Penggunaan
|
| 77 |
+
|
| 78 |
+
Checkpoint di repository ini dalam format native (PyTorch `.pt`/state_dict sesuai arsitektur asli - bukan format `transformers`), sehingga perlu dimuat menggunakan kode arsitektur model asli (YOLOv12 & HSCN), bukan lewat `AutoModel` dari library `transformers`.
|
| 79 |
+
|
| 80 |
+
Contoh unduh checkpoint dengan `huggingface_hub`:
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from huggingface_hub import hf_hub_download
|
| 84 |
+
|
| 85 |
+
# Contoh: unduh checkpoint YOLOv12-Large
|
| 86 |
+
yolo_ckpt = hf_hub_download(
|
| 87 |
+
repo_id="afinnn/hscn-waste-checkpoints",
|
| 88 |
+
filename="waste_detection_results_yolol/<nama_file_checkpoint>"
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
# Contoh: unduh checkpoint HSCN ConvNeXt-Small
|
| 92 |
+
hscn_ckpt = hf_hub_download(
|
| 93 |
+
repo_id="afinnn/hscn-waste-checkpoints",
|
| 94 |
+
filename="waste_hscn_results_convnext_small/<nama_file_checkpoint>"
|
| 95 |
+
)
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
Lalu muat checkpoint sesuai kelas model masing-masing (YOLOv12 loader / HSCN `nn.Module` custom) pada kode training/inference.
|
| 99 |
+
|
| 100 |
+
## Arsitektur Pipeline
|
| 101 |
+
|
| 102 |
+
Sistem bekerja dalam dua tahap yang berurutan: deteksi objek diikuti klasifikasi hierarkis pada tiap objek yang terdeteksi.
|
| 103 |
+
|
| 104 |
+
```mermaid
|
| 105 |
+
flowchart TD
|
| 106 |
+
A["Gambar Input"] --> B["Tahap 1: Deteksi Objek\nYOLOv12"]
|
| 107 |
+
B --> C["Crop Objek Terdeteksi\n(per bounding box)"]
|
| 108 |
+
C --> D["Tahap 2: Klasifikasi Hierarkis\nHSCN (ConvNeXt-Small)"]
|
| 109 |
+
D --> E["L1: Waste Management"]
|
| 110 |
+
D --> F["L2: Material"]
|
| 111 |
+
D --> G["L3: Specific Object"]
|
| 112 |
+
E --> H["Output Akhir:\nBounding Box + Label Hierarkis L1/L2/L3"]
|
| 113 |
+
F --> H
|
| 114 |
+
G --> H
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
| Tahap | Komponen | Input | Output |
|
| 118 |
+
|---|---|---|---|
|
| 119 |
+
| 1. Deteksi | YOLOv12 | Gambar mentah | Bounding box objek sampah |
|
| 120 |
+
| 2. Cropping | - | Bounding box | Citra hasil crop per objek |
|
| 121 |
+
| 3. Klasifikasi | HSCN (backbone ConvNeXt-Small) | Citra hasil crop | Label hierarkis L1, L2, L3 |
|
| 122 |
+
| 4. Output | - | Bounding box + label | Deteksi lengkap dengan klasifikasi 3 level |
|
| 123 |
+
|
| 124 |
+
## Sitasi
|
| 125 |
+
|
| 126 |
+
Jika menggunakan model ini, mohon sitasi paper terkait (SENTRIN) - detail sitasi akan diperbarui setelah publikasi resmi.
|
| 127 |
+
|
| 128 |
+
```bibtex
|
| 129 |
+
@inproceedings{hscn-waste-2026,
|
| 130 |
+
title={Two-Stage Waste Detection and Hierarchical Classification using YOLOv12 and HSCN},
|
| 131 |
+
author={Afin},
|
| 132 |
+
booktitle={SENTRIN},
|
| 133 |
+
year={2026}
|
| 134 |
+
}
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
## Lisensi
|
| 138 |
+
|
| 139 |
+
MIT License - bebas digunakan untuk riset dan pengembangan lebih lanjut, dengan tetap mencantumkan atribusi.
|
| 140 |
+
|
| 141 |
+
## Kontak
|
| 142 |
+
|
| 143 |
+
Untuk pertanyaan lebih lanjut mengenai model atau kolaborasi, silakan hubungi melalui profil Hugging Face [@afinnn](https://huggingface.co/afinnn).
|