TaskAlignedLossOptions
Options & Configuration · AiDotNet.ComputerVision.Detection.Losses
Assignment and loss settings for task-aligned anchor-free YOLO training.
For Beginners
A YOLO model predicts a box and class scores at every grid cell. These settings decide which cells are responsible for each real object and how strongly each part of the prediction is corrected.
How It Works
Defaults follow the published YOLO recipes. Task-aligned assignment ranks anchors inside each object by t = s^alpha * IoU^beta (Feng et al. 2021, TOOD), with alpha 0.5 and beta 6 as in YOLOv8 and both YOLOv10 heads (Wang et al. 2024, Sec. 3.1). Losses are BCE classification against the normalized alignment target, CIoU box regression and distribution focal loss (Li et al. 2020), weighted by the box/class/DFL gains 7.5/0.5/1.5 (YOLOv9 Table 1; YOLOv10 Table 14). YOLOv10’s one-to-one head uses top-1 selection.
Constructors
| Constructor | Summary |
|---|---|
TaskAlignedLossOptions() |
Properties
| Property | Summary |
|---|---|
double Alpha { get; set; } |
Exponent of the classification score in the alignment metric. |
double Beta { get; set; } |
Exponent of the IoU in the alignment metric. |
double BoxGain { get; set; } |
Weight of the CIoU box loss. |
double ClassGain { get; set; } |
Weight of the BCE classification loss. |
double DflGain { get; set; } |
Weight of the distribution focal loss. |
int OneToOneTopK { get; set; } |
Anchors selected per object by YOLOv10’s one-to-one head. |
int TopK { get; set; } |
Anchors selected per object by the one-to-many assignment. |