Instructions to use JustFadjrin/batik-vit-model-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JustFadjrin/batik-vit-model-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="JustFadjrin/batik-vit-model-classification") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("JustFadjrin/batik-vit-model-classification") model = AutoModelForImageClassification.from_pretrained("JustFadjrin/batik-vit-model-classification") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +55 -0
- classification_report.txt +26 -0
- config.json +70 -0
- confusion_matrix.png +3 -0
- labels.json +68 -0
- model.safetensors +3 -0
- model_info.json +37 -0
- preprocessor_config.json +23 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
confusion_matrix.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc0-1.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: image-classification
|
| 5 |
+
tags:
|
| 6 |
+
- image-classification
|
| 7 |
+
- vision-transformer
|
| 8 |
+
- vit
|
| 9 |
+
- batik
|
| 10 |
+
- indonesia
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Batik ViT Model Confident
|
| 14 |
+
|
| 15 |
+
Model ini adalah model klasifikasi jenis batik berbasis Vision Transformer (ViT).
|
| 16 |
+
|
| 17 |
+
Model digunakan pada project **Batik ViT Classifier** untuk mengklasifikasikan gambar batik Indonesia.
|
| 18 |
+
|
| 19 |
+
## Dataset
|
| 20 |
+
|
| 21 |
+
Dataset berasal dari Kaggle:
|
| 22 |
+
|
| 23 |
+
**Batik Nusantara (Batik Indonesia) Dataset**
|
| 24 |
+
Author: HendryHB
|
| 25 |
+
Link: https://www.kaggle.com/datasets/hendryhb/batik-nusantara-batik-indonesia-dataset
|
| 26 |
+
|
| 27 |
+
## Jenis Batik yang Dapat Dideteksi
|
| 28 |
+
|
| 29 |
+
Model ini dilatih untuk mengenali 20 jenis batik:
|
| 30 |
+
|
| 31 |
+
1. Aceh Pintu Aceh
|
| 32 |
+
2. Bali Barong
|
| 33 |
+
3. Bali Merak
|
| 34 |
+
4. DKI Ondel Ondel
|
| 35 |
+
5. Jawa Barat Megamendung
|
| 36 |
+
6. Jawa Timur Pring
|
| 37 |
+
7. Kalimantan Dayak
|
| 38 |
+
8. Lampung Gajah
|
| 39 |
+
9. Madura Mataketeran
|
| 40 |
+
10. Maluku Pala
|
| 41 |
+
11. NTB Lumbung
|
| 42 |
+
12. Papua Asmat
|
| 43 |
+
13. Papua Cendrawasih
|
| 44 |
+
14. Papua Tifa
|
| 45 |
+
15. Solo Parang
|
| 46 |
+
16. Sulawesi Selatan Lontara
|
| 47 |
+
17. Sumatera Barat Rumah Minang
|
| 48 |
+
18. Sumatera Utara Boraspati
|
| 49 |
+
19. Yogyakarta Kawung
|
| 50 |
+
20. Yogyakarta Parang
|
| 51 |
+
|
| 52 |
+
## Catatan
|
| 53 |
+
|
| 54 |
+
Model ini tidak 100% akurat karena dataset masih terbatas dan jenis batik di Indonesia sangat banyak.
|
| 55 |
+
Hasil prediksi dipengaruhi oleh kualitas gambar, pencahayaan, sudut pengambilan foto, background, dan kemiripan motif antar kelas.
|
classification_report.txt
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
precision recall f1-score support
|
| 2 |
+
|
| 3 |
+
Aceh_Pintu_Aceh 1.0000 0.7500 0.8571 8
|
| 4 |
+
Bali_Barong 0.8889 1.0000 0.9412 8
|
| 5 |
+
Bali_Merak 0.8889 1.0000 0.9412 8
|
| 6 |
+
DKI_Ondel_Ondel 1.0000 1.0000 1.0000 8
|
| 7 |
+
JawaBarat_Megamendung 1.0000 1.0000 1.0000 8
|
| 8 |
+
JawaTimur_Pring 1.0000 1.0000 1.0000 8
|
| 9 |
+
Kalimantan_Dayak 1.0000 1.0000 1.0000 8
|
| 10 |
+
Lampung_Gajah 0.8750 0.8750 0.8750 8
|
| 11 |
+
Madura_Mataketeran 1.0000 1.0000 1.0000 8
|
| 12 |
+
Maluku_Pala 1.0000 1.0000 1.0000 8
|
| 13 |
+
NTB_Lumbung 0.8000 1.0000 0.8889 8
|
| 14 |
+
Papua_Asmat 1.0000 1.0000 1.0000 8
|
| 15 |
+
Papua_Cendrawasih 1.0000 0.8750 0.9333 8
|
| 16 |
+
Papua_Tifa 1.0000 0.8750 0.9333 8
|
| 17 |
+
Solo_Parang 0.5000 0.3750 0.4286 8
|
| 18 |
+
SulawesiSelatan_Lontara 1.0000 1.0000 1.0000 8
|
| 19 |
+
SumateraBarat_Rumah_Minang 0.8750 0.8750 0.8750 8
|
| 20 |
+
SumateraUtara_Boraspati 1.0000 1.0000 1.0000 8
|
| 21 |
+
Yogyakarta_Kawung 1.0000 1.0000 1.0000 8
|
| 22 |
+
Yogyakarta_Parang 0.5000 0.6250 0.5556 8
|
| 23 |
+
|
| 24 |
+
accuracy 0.9125 160
|
| 25 |
+
macro avg 0.9164 0.9125 0.9115 160
|
| 26 |
+
weighted avg 0.9164 0.9125 0.9115 160
|
config.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ViTForImageClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.0,
|
| 6 |
+
"dtype": "float32",
|
| 7 |
+
"encoder_stride": 16,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.0,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "Aceh_Pintu_Aceh",
|
| 13 |
+
"1": "Bali_Barong",
|
| 14 |
+
"2": "Bali_Merak",
|
| 15 |
+
"3": "DKI_Ondel_Ondel",
|
| 16 |
+
"4": "JawaBarat_Megamendung",
|
| 17 |
+
"5": "JawaTimur_Pring",
|
| 18 |
+
"6": "Kalimantan_Dayak",
|
| 19 |
+
"7": "Lampung_Gajah",
|
| 20 |
+
"8": "Madura_Mataketeran",
|
| 21 |
+
"9": "Maluku_Pala",
|
| 22 |
+
"10": "NTB_Lumbung",
|
| 23 |
+
"11": "Papua_Asmat",
|
| 24 |
+
"12": "Papua_Cendrawasih",
|
| 25 |
+
"13": "Papua_Tifa",
|
| 26 |
+
"14": "Solo_Parang",
|
| 27 |
+
"15": "SulawesiSelatan_Lontara",
|
| 28 |
+
"16": "SumateraBarat_Rumah_Minang",
|
| 29 |
+
"17": "SumateraUtara_Boraspati",
|
| 30 |
+
"18": "Yogyakarta_Kawung",
|
| 31 |
+
"19": "Yogyakarta_Parang"
|
| 32 |
+
},
|
| 33 |
+
"image_size": 224,
|
| 34 |
+
"initializer_range": 0.02,
|
| 35 |
+
"intermediate_size": 3072,
|
| 36 |
+
"label2id": {
|
| 37 |
+
"Aceh_Pintu_Aceh": 0,
|
| 38 |
+
"Bali_Barong": 1,
|
| 39 |
+
"Bali_Merak": 2,
|
| 40 |
+
"DKI_Ondel_Ondel": 3,
|
| 41 |
+
"JawaBarat_Megamendung": 4,
|
| 42 |
+
"JawaTimur_Pring": 5,
|
| 43 |
+
"Kalimantan_Dayak": 6,
|
| 44 |
+
"Lampung_Gajah": 7,
|
| 45 |
+
"Madura_Mataketeran": 8,
|
| 46 |
+
"Maluku_Pala": 9,
|
| 47 |
+
"NTB_Lumbung": 10,
|
| 48 |
+
"Papua_Asmat": 11,
|
| 49 |
+
"Papua_Cendrawasih": 12,
|
| 50 |
+
"Papua_Tifa": 13,
|
| 51 |
+
"Solo_Parang": 14,
|
| 52 |
+
"SulawesiSelatan_Lontara": 15,
|
| 53 |
+
"SumateraBarat_Rumah_Minang": 16,
|
| 54 |
+
"SumateraUtara_Boraspati": 17,
|
| 55 |
+
"Yogyakarta_Kawung": 18,
|
| 56 |
+
"Yogyakarta_Parang": 19
|
| 57 |
+
},
|
| 58 |
+
"layer_norm_eps": 1e-12,
|
| 59 |
+
"model_type": "vit",
|
| 60 |
+
"num_attention_heads": 12,
|
| 61 |
+
"num_channels": 3,
|
| 62 |
+
"num_hidden_layers": 12,
|
| 63 |
+
"patch_size": 16,
|
| 64 |
+
"pooler_act": "tanh",
|
| 65 |
+
"pooler_output_size": 768,
|
| 66 |
+
"problem_type": "single_label_classification",
|
| 67 |
+
"qkv_bias": true,
|
| 68 |
+
"transformers_version": "5.0.0",
|
| 69 |
+
"use_cache": false
|
| 70 |
+
}
|
confusion_matrix.png
ADDED
|
Git LFS Details
|
labels.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"class_names": [
|
| 3 |
+
"Aceh_Pintu_Aceh",
|
| 4 |
+
"Bali_Barong",
|
| 5 |
+
"Bali_Merak",
|
| 6 |
+
"DKI_Ondel_Ondel",
|
| 7 |
+
"JawaBarat_Megamendung",
|
| 8 |
+
"JawaTimur_Pring",
|
| 9 |
+
"Kalimantan_Dayak",
|
| 10 |
+
"Lampung_Gajah",
|
| 11 |
+
"Madura_Mataketeran",
|
| 12 |
+
"Maluku_Pala",
|
| 13 |
+
"NTB_Lumbung",
|
| 14 |
+
"Papua_Asmat",
|
| 15 |
+
"Papua_Cendrawasih",
|
| 16 |
+
"Papua_Tifa",
|
| 17 |
+
"Solo_Parang",
|
| 18 |
+
"SulawesiSelatan_Lontara",
|
| 19 |
+
"SumateraBarat_Rumah_Minang",
|
| 20 |
+
"SumateraUtara_Boraspati",
|
| 21 |
+
"Yogyakarta_Kawung",
|
| 22 |
+
"Yogyakarta_Parang"
|
| 23 |
+
],
|
| 24 |
+
"label2id": {
|
| 25 |
+
"Aceh_Pintu_Aceh": 0,
|
| 26 |
+
"Bali_Barong": 1,
|
| 27 |
+
"Bali_Merak": 2,
|
| 28 |
+
"DKI_Ondel_Ondel": 3,
|
| 29 |
+
"JawaBarat_Megamendung": 4,
|
| 30 |
+
"JawaTimur_Pring": 5,
|
| 31 |
+
"Kalimantan_Dayak": 6,
|
| 32 |
+
"Lampung_Gajah": 7,
|
| 33 |
+
"Madura_Mataketeran": 8,
|
| 34 |
+
"Maluku_Pala": 9,
|
| 35 |
+
"NTB_Lumbung": 10,
|
| 36 |
+
"Papua_Asmat": 11,
|
| 37 |
+
"Papua_Cendrawasih": 12,
|
| 38 |
+
"Papua_Tifa": 13,
|
| 39 |
+
"Solo_Parang": 14,
|
| 40 |
+
"SulawesiSelatan_Lontara": 15,
|
| 41 |
+
"SumateraBarat_Rumah_Minang": 16,
|
| 42 |
+
"SumateraUtara_Boraspati": 17,
|
| 43 |
+
"Yogyakarta_Kawung": 18,
|
| 44 |
+
"Yogyakarta_Parang": 19
|
| 45 |
+
},
|
| 46 |
+
"id2label": {
|
| 47 |
+
"0": "Aceh_Pintu_Aceh",
|
| 48 |
+
"1": "Bali_Barong",
|
| 49 |
+
"2": "Bali_Merak",
|
| 50 |
+
"3": "DKI_Ondel_Ondel",
|
| 51 |
+
"4": "JawaBarat_Megamendung",
|
| 52 |
+
"5": "JawaTimur_Pring",
|
| 53 |
+
"6": "Kalimantan_Dayak",
|
| 54 |
+
"7": "Lampung_Gajah",
|
| 55 |
+
"8": "Madura_Mataketeran",
|
| 56 |
+
"9": "Maluku_Pala",
|
| 57 |
+
"10": "NTB_Lumbung",
|
| 58 |
+
"11": "Papua_Asmat",
|
| 59 |
+
"12": "Papua_Cendrawasih",
|
| 60 |
+
"13": "Papua_Tifa",
|
| 61 |
+
"14": "Solo_Parang",
|
| 62 |
+
"15": "SulawesiSelatan_Lontara",
|
| 63 |
+
"16": "SumateraBarat_Rumah_Minang",
|
| 64 |
+
"17": "SumateraUtara_Boraspati",
|
| 65 |
+
"18": "Yogyakarta_Kawung",
|
| 66 |
+
"19": "Yogyakarta_Parang"
|
| 67 |
+
}
|
| 68 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c958e62f4f4a19dd4b9a5a0be7927443e2edc7404b6c35b1c2b769c17b10dbd0
|
| 3 |
+
size 343279344
|
model_info.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_name": "google/vit-base-patch16-224-in21k",
|
| 3 |
+
"num_classes": 20,
|
| 4 |
+
"class_names": [
|
| 5 |
+
"Aceh_Pintu_Aceh",
|
| 6 |
+
"Bali_Barong",
|
| 7 |
+
"Bali_Merak",
|
| 8 |
+
"DKI_Ondel_Ondel",
|
| 9 |
+
"JawaBarat_Megamendung",
|
| 10 |
+
"JawaTimur_Pring",
|
| 11 |
+
"Kalimantan_Dayak",
|
| 12 |
+
"Lampung_Gajah",
|
| 13 |
+
"Madura_Mataketeran",
|
| 14 |
+
"Maluku_Pala",
|
| 15 |
+
"NTB_Lumbung",
|
| 16 |
+
"Papua_Asmat",
|
| 17 |
+
"Papua_Cendrawasih",
|
| 18 |
+
"Papua_Tifa",
|
| 19 |
+
"Solo_Parang",
|
| 20 |
+
"SulawesiSelatan_Lontara",
|
| 21 |
+
"SumateraBarat_Rumah_Minang",
|
| 22 |
+
"SumateraUtara_Boraspati",
|
| 23 |
+
"Yogyakarta_Kawung",
|
| 24 |
+
"Yogyakarta_Parang"
|
| 25 |
+
],
|
| 26 |
+
"train_samples": 512,
|
| 27 |
+
"validation_samples": 128,
|
| 28 |
+
"test_samples": 160,
|
| 29 |
+
"test_accuracy": 0.9125,
|
| 30 |
+
"test_macro_f1": 0.9114589169000935,
|
| 31 |
+
"average_confidence_all": 0.7706013917922974,
|
| 32 |
+
"average_confidence_correct": 0.7880493402481079,
|
| 33 |
+
"average_margin_all": 0.728288471698761,
|
| 34 |
+
"recommended_threshold_high": 0.6,
|
| 35 |
+
"recommended_threshold_medium": 0.4,
|
| 36 |
+
"recommended_margin": 0.2
|
| 37 |
+
}
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": null,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "ViTImageProcessor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"resample": 2,
|
| 18 |
+
"rescale_factor": 0.00392156862745098,
|
| 19 |
+
"size": {
|
| 20 |
+
"height": 224,
|
| 21 |
+
"width": 224
|
| 22 |
+
}
|
| 23 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5014926af151076c390ca67959e1747b032f71d4ef5e752cd6fa481813f0f1db
|
| 3 |
+
size 5265
|