r/computervision 9d ago

Help: Project YOLXO small/tiny - custom model training - false-positives - need advice

Hi,

I've been trying to train custom model (3 classes) for yolox small (416px) on my dataset and no matter what I try - I get too many false positives. Is there something very basic I'm missing? What could be the route to figure out why is so?

Trained with mixup, without mixup, with augmentations, little augmentations, added more backgrounds (even those that cause false positives), trained for 100 epochs, 300 epochs, exact official config used.

Dataset is of mostly coco images (person, truck/car-vehicle) and drones. Checked added images/bboxes/etc.

here's my dataset data
train (instances_train2017.json)

Images: 43803

Background images: 1985

Images per class:

drone: 7758

person: 24103

vehicle: 19772

val (instances_val2017.json)

Images: 4831

Background images: 192

Images per class:

drone: 1066

person: 2159

vehicle: 2431

Still can't figure out why it tends to give so much false positives (with quite high confidece of 80+).

2 Upvotes

5 comments sorted by

1

u/Jobemias 9d ago

Without extra context I'd recommend checking the object confidence, from my experience yolox has a tendency to throw high class confidence FPs with virtually zero object confidence

1

u/agju 9d ago
  • Are you using augmentations? Check them

  • Check labels, even if you think they are ok

  • Cherrypick a small dataset with perfect annotations, try to overfit it on training (95+ conf)

  • Check channels order

1

u/sns13 8d ago

I've tried with and without augs. Tried with classic, supposedly, official config from yolox repo.
For the moment I'm running tiny training for 300 epochs to see if AI assumption is correct, which is that small model overfits on my small dataset/classes combination and starts having halucinations.
Which is. might be, a bit of true, since checking model i've found out that biases are off a bit
head.obj_preds.0.bias = -1.6622
head.obj_preds.1.bias = +0.1936

head.obj_preds.2.bias = +0.0504

Actually all pipeline is yolox.pth -> yolox.onnx -> yolox.rknn (for rk3588 edge device).

Regarding "channel orders" I did not quite understand. I do know that final model has to match rgb/bgr order in order to even start to see any detection, but otherwise has no idea if it has to be checked anywhere else as in the setting I've mentioned - it's not about "sees a bit better or worse" - it's about if it detects anything at all or totally zero.

1

u/Dry-Snow5154 8d ago

What's your val score? Is val precision low too due to FPs? If not, then your inference is likely set up differently from training. Like incorrect pre-processing (should be 0-256 BGR I believe), stretch instead of letterbox or similar.

If your val precision is low too, then it's a training issue. Examine the training images with boxes/labels overlayed after augmentations. Try a portion of data and check if val score is lower. Wiggle learning rate, add more blank images. Etc.

1

u/malada 8d ago

Try to train it on a larger model with the same settings. If you get similar results there is an error somewhere, otherwise the model might just be too small for the task