Skip to content

Performance Issue Fine-Tuning D-FINE S with custom dataset #108

Open
@sergiosanchoasensio

Description

@sergiosanchoasensio

Hi everyone,

I’m fine-tuning the D-FINE S model initialized with Objects365 weights using a custom dataset, but I’m encountering significantly lower performance than expected.

Performance Comparison
In just a single epoch:

  • D-FINE S achieves mAP@50=0.384.
  • YOLOv11 S (initialized with COCO weights) achieves mAP@50=0.842.

1. Dataset Preparation:

  • Converted custom dataset annotations (x1,y1,x2,y2) to COCO format (x1, y1, w, h).
  • Since the dataset includes truncated images, I added in the train.py:
    ImageFile.LOAD_TRUNCATED_IMAGES = True
  • This dataset contains only one class, category_id=0, so I set num_classes: 1 and remap_mscoco_category: False.

2. Configuration Changes:

  • Using dfine_hgnetv2_s_obj2custom.yml as the base configuration.
  • Modified only the dataset path and adjusted the batch size to 8 for both training and validation.

3. Training Command:

CUDA_VISIBLE_DEVICES=0 torchrun --master_port=7777 --nproc_per_node=1 train.py \
  -c configs/dfine/custom/objects365/dfine_hgnetv2_s_obj2custom.yml \
  --seed=0 -t dfine_s_obj365.pth

What could be causing the poor performance?
I’d appreciate any insights or suggestions for debugging this issue. Thanks in advance!

PS: I tried fine-tuning for 20 epochs, and the mAP@50 only improves slightly to 0.4. Using COCO weights instead of Objects365 weights does not lead to any improvement either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions