[Question] I’m doing Yolov8 model training but the accuracy rate is 70%

I’m currently working on training a YOLOv8 model for my project. The goal is to train this model to recognize the product’s stock code from a photo sent to a chatbot.

I have 1,522 stock codes, with about 10-15 photos for each stock code. Although the number of photos is a bit low, our customers typically send us the same photos used in training. For example, they might take a screenshot from our Instagram profile and send it to us.

I’m training the model, but it’s only achieving around 70% accuracy. I believe the issue might be related to the hyperparameters, but I’m not very familiar with them. I would really appreciate any suggestions or advice you could offer.

hyp.yaml



""

# Learning Rate ve Momentum Ayarları
lr0: 0.01          # Başlangıç öğrenme oranı
lrf: 0.01          # Final öğrenme oranı (lr0 ile çarpılır)
momentum: 0.9      # SGD momentum
weight_decay: 0.0005  # L2 regularizasyonu (weight decay)
warmup_epochs: 2.0   # Isınma epoch sayısı
warmup_momentum: 0.8 # Isınma süresince başlangıç momentumu
warmup_bias_lr: 0.1  # Isınma süresince bias için öğrenme oranı
# Kayıp Fonksiyonu (Loss Function) Ayarları
box: 0.05           # Box kaybı kazancı (GIoU/DIoU/CIoU)
cls: 0.5            # Sınıf kaybı kazancı
iou: 0.2            # IoU eşiği (labeling için)
kobj: 1.0           # Nesne kaybı kazancı
# Augmentation Ayarları (Veri artırma)
hsv_h: 0.005        # Görüntü HSV-Hue artırma (fraction) - Çok küçük değişiklikler
hsv_s: 0.1          # Görüntü HSV-Saturation artırma (fraction) - Çok küçük değişiklikler
hsv_v: 0.1          # Görüntü HSV-Value artırma (fraction) - Çok küçük değişiklikler
degrees: 0.0        # Görüntü döndürme (+/- derece)
translate: 0.1      # Görüntü kaydırma (+/- fraction)a
scale: 0.5          # Görüntü ölçekleme (+/- kazanç)
shear: 0.0          # Görüntü kaydırma (+/- derece)
perspective: 0.0    # Görüntü perspektifi (+/- fraction), 0-0.001 arası
flipud: 0.0         # Görüntüyü yukarıdan aşağıya çevirme (olasılık)
fliplr: 0.5         # Görüntüyü sağdan sola çevirme (olasılık)
mosaic: 0.0         # Mosaic artırma (olasılık) - Bu durumda kapalı
mixup: 0.0          # Mixup artırma (olasılık) - Bu durumda kapalı
copy_paste: 0.0     # Copy-paste artırma (olasılık) - Bu durumda kapalı

""

train.py =

from ultralytics import YOLO
import wandb
from wandb.integration.ultralytics import add_wandb_callback
# WandB oturumunu başlatın
if __name__ == “__main__”:
    wandb.login()
    wandb.init(project=”ultralytics”, job_type=”training”)
    # Modeli yükleyin
    model = YOLO(‘yolov8n.pt’)
    # WandB callback’ini ekleyin
    add_wandb_callback(model, enable_model_checkpointing=True)
    # Modeli eğitin
    model.train(
        data=‘y.yaml’,            # Veri kümesi yapılandırma dosyası
        epochs=100,               # Eğitim epoch sayısı
        batch=16,                 # Batch boyutu
        project=‘my_project’,     # Proje adı (varsayılan: runs/​train)
        name=‘exp’,               # Deneme adı (varsayılan: exp)
        cfg=‘hyp.yaml’                   # Hyperparameters ayarları
    )
    # WandB oturumunu sonlandırın
    wandb.finish()