How is the YOLOv8 best loss model selected by the trainer class?

Question:

From the YOLOv8 documentation, it is not clear to me which loss metric the YOLOv8 trainer class uses in determining the best loss model that is saved in a training run. Is it based on the validation or training loss?

Specifically, when I look at the outputs from a YOLOv8 training run, I do not see any metadata indicating which epoch resulted in the best loss model saved at runs/train/weights/best.pt

Asked By: Austin

||

Answers:

In the save_model function you can see that it uses the maximum fitness to save the best model. The fitness is defined as the weighted combination of 4 metrics [P, R, [email protected], [email protected]:0.95]. P and R are disregarded for some reason. [email protected], [email protected]:0.95 are weighted 0.1 and 0.9 respectively.

If fitness cannot be found, loss is used instead

Answered By: Mike B
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.