Repository navigation
Expand file tree
/
Copy pathconfig.schema.json
More file actions
575 lines (575 loc) · 64.5 KB
/
Copy pathconfig.schema.json
File metadata and controls
575 lines (575 loc) · 64.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/oriented-det/config.schema.json",
"title": "OrientedDet Training Configuration",
"description": "Schema for training config files used by tools/train.py. Supports MMRotate-style _base_ inheritance. Written config.json key order: switches first (enable_*), then sections; within sections switch/type first, then keys with same prefix (e.g. lr_scheduler_type then lr_*, roi_*, rpn_*).",
"type": "object",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"_base_": {
"description": "Path(s) to base config(s) to inherit from. Loaded and merged before this config. Paths are relative to the current config file.",
"oneOf": [
{ "type": "string", "minLength": 1 },
{ "type": "array", "items": { "type": "string", "minLength": 1 } }
]
},
"model_type": {
"type": "string",
"enum": ["oriented_rcnn", "rotated_faster_rcnn", "rotated_retinanet"],
"description": "Model variant. Must match tools/train.py: oriented_rcnn, rotated_faster_rcnn, or rotated_retinanet.",
"examples": ["oriented_rcnn", "rotated_retinanet", "rotated_faster_rcnn"]
},
"experiment_timestamp": {
"type": ["string", "null"],
"description": "Optional run id; set when saving a training experiment."
},
"source_recipe": {
"type": ["string", "null"],
"description": "Path to the training recipe JSON used for this run (set when saving config.json)."
},
"source_code_root": {
"type": ["string", "null"],
"description": "Framework source tree used at train start (set when saving config.json)."
},
"git_commit": {
"type": ["string", "null"],
"description": "Full git commit hash of the framework source at train start."
},
"git_describe": {
"type": ["string", "null"],
"description": "Output of git describe --dirty --always --tags at train start."
},
"git_dirty": {
"type": ["boolean", "null"],
"description": "True when the framework source tree had uncommitted changes at train start."
},
"git_branch": {
"type": ["string", "null"],
"description": "Git branch name at train start (may be HEAD when detached)."
},
"git_commit_date": {
"type": ["string", "null"],
"description": "Committer date (ISO 8601) of git_commit at train start."
},
"package_version": {
"type": ["string", "null"],
"description": "Installed oriented-det package version at train start."
},
"class_map": {
"type": ["object", "null"],
"additionalProperties": { "type": "integer" },
"description": "Saved with checkpoints for inference; not required in hand-written training configs."
},
"class_names": {
"type": ["array", "null"],
"items": { "type": "string" },
"description": "Saved with checkpoints; optional in hand-written configs."
},
"num_classes": {
"type": ["integer", "null"],
"description": "Foreground class count; saved with checkpoints, optional in hand-written configs."
},
"dataset": {
"type": "object",
"description": "Dataset paths and filtering.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"format": {
"type": "string",
"default": "dota",
"enum": ["dota", "airbus_playground", "hrsc2016", "fair1m", "ssdd", "hrsid", "yolo_obb", "coco"],
"description": "Dataset format. 'yolo_obb' expects data_root/images/<split>, data_root/labels/<split> (normalized quads) and data_root/classes.txt. 'coco' expects official COCO 2017 train2017/ and val2017/ plus annotations/instances_{train,val}2017.json (bbox as horizontal le90, 80 category ids mapped to labels 1..80). 'dota' expects train_tiles_dir/val_tiles_dir or train_tiles_dirs/val_tiles_dirs. 'airbus_playground' expects annotations_file/split_file. 'hrsc2016' expects official FullDataSet + ImageSets under data_root. 'fair1m' expects official train/validation (+ labelXml) or Kaggle Dataset/Images under data_root; tiled DOTA recipes use format dota after odet fair1m-to-dota. 'ssdd' expects official last-digit train/test (VOC XML, COCO, or DOTA). 'hrsid' expects COCO train2017/test2017 (or trainsplit/testsplit)."
},
"data_root": { "type": "string", "description": "Root directory of the dataset." },
"train_tiles_dir": { "type": "string", "description": "Directory containing training tiles (DOTA format)." },
"val_tiles_dir": { "type": "string", "description": "Directory containing validation tiles (DOTA format)." },
"train_tiles_dirs": {
"type": "array",
"items": { "type": "string" },
"description": "Optional list of training tile roots (union via ConcatDataset). When set, overrides train_tiles_dir."
},
"val_tiles_dirs": {
"type": "array",
"items": { "type": "string" },
"description": "Optional list of validation tile roots (union via ConcatDataset). When set, overrides val_tiles_dir."
},
"test_tiles_dir": { "type": "string", "description": "Directory containing labeled test tiles (DOTA format). Omit when the dataset has no test split." },
"test_tiles_dirs": {
"type": "array",
"items": { "type": "string" },
"description": "Optional list of labeled test tile roots. When set, overrides test_tiles_dir. make eval-test and evaluation.test_map use this split. DOTA sets this to the val tiles (leaky). dota-submit ignores it and uses the unlabeled official test."
},
"same_folder": { "type": "boolean", "default": false, "description": "If true, DOTA images and annotation .txt files are in the same directory (train_tiles_dir and val_tiles_dir). If false, expect train_tiles_dir/images and train_tiles_dir/labels (and same for val)." },
"overlap": {
"description": "Overlap between adjacent tiles in pixels. 0 = none (e.g. DOTA bases); otherwise use a positive even value (e.g. 16 vehicles, 256 planes). Deploy uses an interior margin of overlap/2 px when production.ignore_margin_pixels is null; overlap 0 disables that margin.",
"default": 16,
"oneOf": [
{ "const": 0 },
{ "type": "integer", "minimum": 2, "multipleOf": 2 }
]
},
"annotations_file": { "type": "string", "description": "Annotations CSV file (Airbus Playground format)." },
"split_file": { "type": "string", "description": "Split CSV file (Airbus Playground format)." },
"val_split_id": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "For Airbus split.csv with integer fold ids: which fold id is treated as validation (default 0). Ignored when split.csv uses legacy train/val strings."
},
"train_includes_val": {
"type": "boolean",
"default": false,
"description": "Airbus Playground fold mode only: when true, the train split includes all folds (DOTA trainval parity). Validation still uses val_split_id for monitoring only."
},
"ignore_labels": {
"type": ["array", "null"],
"items": { "type": "string" },
"description": "Labels to ignore for Airbus Playground CSV generation/loading."
},
"lookalike_labels": {
"type": ["array", "null"],
"items": { "type": "string" },
"description": "Optional extra aliases treated as hard-negative lookalikes. The reserved name 'lookalike' is always included. Map confusers via map_labels, e.g. {\"Confuser\":\"lookalike\"}."
},
"map_labels": {
"type": ["object", "null"],
"additionalProperties": { "type": "string" },
"description": "Label remapping dictionary for Airbus Playground, e.g. {\"taxi\":\"car\", \"Confuser\":\"lookalike\", \"car, van and pickup\":\"car\"}. Exact match on the full class_name string after difficult_tags are stripped."
},
"difficult_tags": {
"type": ["array", "null"],
"items": { "type": "string" },
"description": "Exact Playground tags (e.g. \"Partially Hidden\") that set DOTA difficult=1 and are stripped from the semantic class_name at Airbus CSV load/generation. Not ignore_labels (drop) and not lookalike (hard negative). Use with difficult_strategy \"ignore\" for don't-care."
},
"difficult_strategy": { "type": "string", "enum": ["drop", "ignore", "keep"], "default": "drop", "description": "How to handle DOTA 'difficult' annotations: drop at read-time, ignore (MMRotate-style don't-care), or keep as normal GT." },
"filter_empty_gt": { "type": "boolean", "default": false, "description": "Drop samples with no ground truth after difficult_strategy, allowed_classes, and ignore_labels (MMRotate filter_empty_gt parity). Used for DOTA tiles, HRSC2016 images, and FAIR1M images. Default false keeps empty samples." },
"max_train_samples": { "type": ["integer", "null"], "description": "Cap training samples (for overfitting sanity checks)." },
"max_val_samples": { "type": ["integer", "null"], "description": "Cap validation samples." },
"max_samples_shuffle_seed": {
"type": ["integer", "null"],
"description": "When set with max_train_samples or max_val_samples, pick a deterministic random subset (spread across dataset order) instead of the first N indices."
},
"allowed_classes": {
"type": ["array", "null"],
"items": { "type": "string" },
"description": "Restrict to these class names. null = all classes."
},
"train_split": {
"type": ["string", "null"],
"description": "HRSC2016 / FAIR1M split name for the training-loop train role. HRSC null → trainval (MMRotate). FAIR1M null → train. Ignored for DOTA / Airbus."
},
"val_split": {
"type": ["string", "null"],
"description": "HRSC2016 / FAIR1M split name for the training-loop val role. HRSC null → test (MMRotate). FAIR1M null → val. Ignored for DOTA / Airbus."
},
"test_split": {
"type": ["string", "null"],
"default": null,
"description": "Native-format third split (HRSC, FAIR1M, SSDD, HRSID, YOLO-OBB, COCO). Null means no test split. DOTA-layout test data uses test_tiles_dir / test_tiles_dirs."
},
"tile_metrics_csv": {
"type": ["string", "null"],
"description": "CSV from save_predictions tile metrics; join on image_id (stem) to oversample hard tiles."
},
"hard_tile_metric_column": { "type": "string", "default": "f1", "description": "Column in tile_metrics_csv compared to hard_tile_threshold." },
"hard_tile_threshold": { "type": "number", "default": 0.8, "description": "Tiles with metric strictly below this are oversampled." },
"hard_tile_oversample_factor": { "type": "number", "default": 2.0, "description": "Sampling weight multiplier for hard tiles (WeightedRandomSampler)." },
"class_tile_oversample_classes": {
"type": ["array", "null"],
"items": { "type": "string" },
"default": null,
"description": "Train-tile oversampling by GT class presence (no metrics CSV). Tiles with at least class_tile_oversample_min_count boxes whose class_name is in this list (case-sensitive exact, after loader ignore/difficult/lookalike filtering) are upweighted. null or [] disables. Lookalike routing labels are never a match. Unknown names are warned once and ignored."
},
"class_tile_oversample_factor": {
"type": "number",
"default": 1.0,
"description": "Sampling weight multiplier for class-matched train tiles. 1.0 = no extra weight. Composes with hard-tile weights by multiplication when both are enabled (final_weight = hard_weight * class_weight)."
},
"class_tile_oversample_min_count": {
"type": "integer",
"default": 1,
"minimum": 1,
"description": "A train tile matches if it has at least this many GT boxes whose class_name is in class_tile_oversample_classes (after the loader's existing ignore/difficult/lookalike filtering)."
},
"drop_easy_empty_tiles": {
"type": "boolean",
"default": false,
"description": "When tile_metrics_csv is set, drop train tiles with tp=fp=fn=0 (no GT and no preds) before capping and hard-tile oversampling. Empty tiles with false positives stay. Requires dataset.tile_metrics_csv. Keep filter_empty_gt false so hard empty tiles remain in the loader."
}
}
},
"data_loader": {
"type": "object",
"description": "PyTorch DataLoader settings.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"batch_size": { "type": "integer", "default": 16, "minimum": 1, "description": "Samples per batch per GPU." },
"num_workers": { "type": "integer", "default": 4, "minimum": 0, "description": "DataLoader worker processes." },
"shuffle": { "type": "boolean", "default": true, "description": "Shuffle training data each epoch." },
"pin_memory": { "type": "boolean", "default": true, "description": "Pin memory for faster GPU transfer." }
}
},
"model": {
"type": "object",
"description": "Model architecture. Keys grouped by prefix: backbone, fpn_*, anchor_*, target_*, roi_*, rpn_*, nms_*, etc.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"backbone": { "type": "string", "default": "resnet50", "enum": ["resnet18", "resnet34", "resnet50", "resnet101"], "description": "Backbone architecture." },
"pretrained_backbone": { "type": "boolean", "default": true, "description": "Load ImageNet pretrained weights for backbone." },
"trainable_layers": { "type": "integer", "default": 5, "description": "Number of backbone layers to train. 5 = all layers." },
"frozen_stages": { "type": ["integer", "null"], "description": "If set, overrides trainable_layers: freeze this many stages from the start (MMRotate: 1 = freeze stage 1, effective trainable_layers=3)." },
"fpn_returned_layers": { "type": "array", "items": { "type": "integer" }, "default": [1, 2, 3, 4], "description": "Backbone layers for FPN (1-based). Default [1, 2, 3, 4] = C2-C5 (5 levels); [2, 3, 4] = C3-C5 only (4 levels)." },
"fpn_strides": { "type": ["array", "null"], "items": { "type": "integer" }, "description": "Optional nominal FPN strides for ROI module init and logs. Training/inference derive strides from image size and feature map shapes so anchors and ROI align match the grid; a warning is emitted if this list disagrees with the derived values." },
"fpn_extra_level": { "type": "boolean", "default": false, "description": "RetinaNet: append stride-128 FPN level via 3x3 conv (MMRotate P7)." },
"anchor_scales": { "type": "array", "items": { "type": "integer" }, "description": "Anchor scales. Single scale [8] recommended with FPN." },
"anchor_ratios": { "type": "array", "items": { "type": "number" }, "description": "Anchor aspect ratios. e.g. [0.5, 1, 2]." },
"anchor_angles": { "type": ["array", "null"], "items": { "type": "number" }, "default": null, "description": "RetinaNet prior angles in degrees (converted to radians at model build). null/empty = [0] (MMRotate horizontal priors). Example: [-45, 0, 45]." },
"anchor_octave_base_scale": { "type": ["number", "null"], "default": null, "description": "RetinaNet MMRotate octave_base_scale (with anchor_scales_per_octave)." },
"anchor_scales_per_octave": { "type": ["integer", "null"], "default": null, "description": "RetinaNet MMRotate scales_per_octave (e.g. 3)." },
"target_means": { "type": "array", "items": { "type": "number" }, "minItems": 5, "maxItems": 5, "description": "Box regression target means [dx, dy, dw, dh, dangle]." },
"target_stds": { "type": "array", "items": { "type": "number" }, "minItems": 5, "maxItems": 5, "description": "Box regression target stds [dx, dy, dw, dh, dangle]." },
"roi_loss_type": { "type": "string", "enum": ["cross_entropy", "focal"], "default": "cross_entropy", "description": "ROI classification loss: cross_entropy or focal." },
"roi_focal_alpha": { "type": "number", "default": 1.0, "description": "Focal loss alpha (when roi_loss_type is focal)." },
"roi_focal_gamma": { "type": "number", "default": 2.0, "description": "Focal loss gamma (when roi_loss_type is focal)." },
"roi_norm_factor": { "type": ["number", "null"], "description": "Angle scaling for ROI. null for RetinaNet (MMRotate match)." },
"roi_edge_swap": { "type": "boolean", "default": true, "description": "Use edge_swap for ROI bbox coder." },
"roi_proj_xy": { "type": "boolean", "default": false, "description": "If true, encode/decode ROI dx/dy in proposal local frame (MMRotate DeltaXYWHTRBBoxCoder proj_xy)." },
"roi_box_reg_angle_weight": { "type": "number", "default": 1.0, "description": "Weight for angle (5th) in ROI box regression; use > 1 for better alignment." },
"roi_box_reg_angle_schedule_epochs": { "type": ["array", "null"], "items": { "type": "integer" }, "description": "0-based epoch boundaries for roi_box_reg_angle_weight schedule." },
"roi_box_reg_angle_schedule_values": { "type": ["array", "null"], "items": { "type": "number" }, "description": "Angle SmoothL1 weight per schedule segment. When null, roi_box_reg_angle_weight is constant." },
"roi_box_reg_aux_weight": { "type": "number", "default": 0.0, "description": "Auxiliary ROI box-reg weight. When main is smooth_l1, this scales a decoded term (roi_box_reg_aux_loss_type: probiou/riou/kfiou). When main is decoded, this scales encoded Smooth L1 (aux_loss_type: smooth_l1). 0 disables aux." },
"roi_box_reg_aux_schedule_epochs": { "type": ["array", "null"], "items": { "type": "integer" }, "description": "0-based epoch boundaries for roi_box_reg_aux_weight schedule (same convention as final_nms_iou_schedule_epochs)." },
"roi_box_reg_aux_schedule_values": { "type": ["array", "null"], "items": { "type": "number" }, "description": "Auxiliary box-reg weight per schedule segment. When null, roi_box_reg_aux_weight is constant." },
"roi_box_reg_aux_loss_type": { "type": ["string", "null"], "default": null, "enum": [null, "smooth_l1", "riou", "kfiou", "probiou"], "description": "Auxiliary ROI box-reg term when roi_box_reg_aux_weight > 0. Must differ from roi_box_reg_main_loss_type: decoded (riou/kfiou/probiou) when main is smooth_l1; smooth_l1 when main is decoded." },
"roi_box_reg_kfiou_fun": { "type": ["string", "null"], "default": null, "enum": [null, "none", "ln", "exp"], "description": "When a decoded ROI term is kfiou (main or aux), overlap mapping: none → 1-KFIoU; ln → -log(KFIoU); exp → exp(1-KFIoU)-1." },
"roi_box_reg_probiou_mode": { "type": ["string", "null"], "default": null, "enum": [null, "l1", "l2"], "description": "When a decoded ROI term is probiou (main or aux), metric variant: l1 (bounded, default) or l2 (-log(1-l1^2))." },
"roi_box_reg_main_loss_type": { "type": "string", "default": "smooth_l1", "enum": ["smooth_l1", "probiou", "riou", "kfiou"], "description": "Primary ROI box regression loss for Rotated Faster R-CNN: smooth_l1 (encoded) or decoded probiou/riou/kfiou." },
"roi_box_reg_norm": { "type": "string", "default": "sampled_all", "enum": ["sampled_all", "positives_only"], "description": "Smooth L1 normalization: sampled_all (MMDet avg_factor over pos+neg) or positives_only (mean over positives)." },
"retinanet_stacked_convs": { "type": "integer", "default": 1, "minimum": 1, "description": "RetinaNet shared 3x3 conv depth before cls/reg (MMRotate: 4)." },
"box_reg_loss_type": { "type": "string", "default": "smooth_l1", "enum": ["smooth_l1", "l1", "kfiou", "riou"], "description": "RetinaNet: smooth_l1/l1 encoded. FCOS: l1 (encoded), kfiou (decoded KFIoU), or riou (decoded differentiable polygon IoU, 1-IoU). FCOS riou is not sampling pairwise_rotated_iou. YOLO-OBB: riou replaces ProbIoU with 1 - rotated IoU; the default smooth_l1 stays ProbIoU. Rejected together with yolo_obb_force_horizontal." },
"box_reg_weight": { "type": "number", "default": 1.0, "description": "RetinaNet/FCOS box regression loss weight." },
"fcos_stacked_convs": { "type": "integer", "default": 4, "minimum": 1, "description": "Rotated FCOS conv tower depth (MMRotate: 4)." },
"fcos_center_sampling": { "type": "boolean", "default": true, "description": "FCOS center sampling around GT centers." },
"fcos_center_sample_radius": { "type": "number", "default": 1.5, "description": "FCOS center sample radius in stride units." },
"fcos_norm_on_bbox": { "type": "boolean", "default": true, "description": "Normalize FCOS ltrb targets by FPN stride." },
"fcos_centerness_on_reg": { "type": "boolean", "default": true, "description": "Attach FCOS centerness head to the regression tower." },
"fcos_scale_angle": { "type": "boolean", "default": true, "description": "Learnable Scale on FCOS angle prediction." },
"fcos_regress_ranges": {
"type": ["array", "null"],
"items": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 },
"description": "Per-FPN-level (min,max) regress ranges for FCOS assignment. null = MMRotate defaults."
},
"fcos_angle_weight": { "type": "number", "default": 1.0, "description": "Weight on le90-wrapped angle L1 in FCOS box regression." },
"fcos_nms_pre": { "type": "integer", "default": 2000, "description": "Max FCOS candidates kept per FPN level before NMS." },
"rtmdet_stacked_convs": { "type": "integer", "default": 2, "description": "Rotated RTMDet SepBN head stacked convs per branch." },
"rtmdet_norm_on_bbox": { "type": "boolean", "default": true, "description": "Divide RTMDet box distances by the FPN stride." },
"rtmdet_scale_angle": { "type": "boolean", "default": true, "description": "Learnable scale on the RTMDet angle head." },
"rtmdet_exp_on_reg": { "type": "boolean", "default": true, "description": "Exponentiate RTMDet box-distance predictions." },
"rtmdet_qfl_beta": { "type": "number", "default": 2.0, "description": "Quality focal loss beta for Rotated RTMDet." },
"rtmdet_angle_weight": { "type": "number", "default": 0.2, "description": "Weight on the RTMDet angle L1 term. 0 drops that term; rotated IoU weight stays box_reg_weight." },
"rtmdet_assign_topk": { "type": "integer", "default": 13, "description": "Dynamic soft-label assignment top-k for Rotated RTMDet." },
"rtmdet_soft_center_radius": { "type": "number", "default": 3.0, "description": "Soft center radius (in stride units) for RTMDet assignment." },
"rtmdet_assign_iou_weight": { "type": "number", "default": 3.0, "description": "IoU cost weight in RTMDet dynamic assignment." },
"rtmdet_nms_pre": { "type": "integer", "default": 2000, "description": "Max RTMDet candidates kept per FPN level before NMS." },
"yolo_obb_reg_max": { "type": "integer", "default": 16, "description": "YOLO-OBB distribution focal bins per box side." },
"yolo_obb_tal_topk": { "type": "integer", "default": 13, "description": "Task-aligned assigner top-k for YOLO-OBB." },
"yolo_obb_stride_cls_prior": { "type": "boolean", "default": false, "description": "Per-level YOLO-OBB classifier bias log(5 / num_classes / (640 / stride) ** 2). False uses log(0.01 / 0.99) on every level." },
"yolo_obb_min_gt_side": { "type": "number", "default": 0.0, "description": "Minimum width and height, in pixels, for the YOLO-OBB anchor-center test. 0 uses the raw box. IoU, soft targets, and the encoded regression target keep the real box. 16 matches Ultralytics select_candidates_in_gts." },
"yolo_obb_cls_loss_type": { "type": "string", "enum": ["bce", "qfl"], "default": "bce", "description": "YOLO-OBB classification loss on the assigner's soft targets. bce is binary cross-entropy with gain 0.5. qfl is quality focal loss with beta 2 and gain 3." },
"yolo_obb_assigner": { "type": "string", "enum": ["tal", "dynamic_soft"], "default": "tal", "description": "YOLO-OBB positive assignment. tal ranks every point inside the box by score^0.5 times IoU^6. dynamic_soft is the Rotated RTMDet rule: inside the box and within 3 strides of the center, ranked by classification cost plus 3 times -log IoU, with the matched IoU as the soft target. Top-k stays yolo_obb_tal_topk." },
"yolo_obb_tal_alpha": { "type": "number", "default": 0.5, "description": "Task-aligned assigner classification exponent." },
"yolo_obb_tal_beta": { "type": "number", "default": 6.0, "description": "Task-aligned assigner rotated-IoU exponent." },
"yolo_obb_dfl_weight": { "type": "number", "default": 1.5, "description": "Weight on the YOLO-OBB distribution focal loss." },
"yolo_obb_angle_weight": { "type": "number", "default": 0.2, "description": "Weight on the YOLO-OBB le90 angle L1 term. ProbIoU weight is box_reg_weight." },
"yolo_obb_force_horizontal": { "type": "boolean", "default": false, "description": "Replace the predicted YOLO-OBB angle with a constant 0 outside the graph and train the decoded box with CIoU. Used for horizontal COCO pretrain. Oriented runs keep ProbIoU. angle_weight 0 is not enough to drop the angle head." },
"yolo_obb_nms_pre": { "type": "integer", "default": 2000, "description": "Max YOLO-OBB candidates kept per FPN level before NMS." },
"aux_loss_type": { "type": ["string", "null"], "default": null, "enum": [null, "kfiou", "probiou"], "description": "FCOS decoded auxiliary box loss on positives (centerness-weighted). Use with aux_loss_weight > 0 and L1 primary. Sampling riou is rejected. Includes an aspect-gated heading term unless aux_angle_weight is 0." },
"aux_loss_weight": { "type": "number", "default": 0.0, "description": "Weight for FCOS aux_loss_type. 0 disables aux. Typical 0.1 with L1 primary." },
"aux_angle_weight": { "type": "number", "default": 1.0, "description": "Weight of the aspect-gated heading term inside FCOS decoded aux (ω sin²(2Δθ)). 0 disables; ignored when aux is off. Typical 1.0." },
"aux_angle_lambda": { "type": "number", "default": 1.0, "description": "λ for the GT aspect gate ω = exp(-log²(w*/h*)/λ²). Must be > 0 when aux_angle_weight > 0. λ=1 → ω≈0.62 at AR=2, ω≈0.30 at AR=3." },
"roi_batch_size_per_image": { "type": "integer", "default": 512, "description": "ROI proposals to sample per image for training." },
"roi_positive_iou_threshold": { "type": "number", "default": 0.5, "description": "IoU threshold for positive ROI proposals." },
"roi_negative_iou_threshold": { "type": "number", "default": 0.5, "description": "IoU threshold for negative ROI proposals." },
"roi_match_low_quality": { "type": "boolean", "default": false, "description": "Force best proposal per GT to positive (MMRotate RCNN: false)." },
"roi_min_pos_iou": { "type": "number", "default": 0.5, "description": "Min IoU for low-quality ROI matches when roi_match_low_quality is true (MMRotate RCNN assigner min_pos_iou)." },
"rpn_min_size": { "type": "number", "default": 0.0, "description": "Min proposal side length in pixels. 2-4 filters tiny boxes." },
"rpn_pre_nms_top_n": { "type": "integer", "default": 2000, "description": "Max RPN proposals to keep before NMS per level." },
"rpn_post_nms_top_n": { "type": "integer", "default": 1000, "description": "Max RPN proposals after NMS (fed to ROI head)." },
"rpn_nms_threshold": { "type": "number", "default": 0.7, "description": "RPN proposal NMS IoU threshold (Rotated Faster R-CNN / Oriented R-CNN)." },
"rpn_batch_size_per_image": { "type": "integer", "default": 256, "description": "RPN anchors to sample per image (MMRotate: 256)." },
"rpn_positive_iou_threshold": { "type": "number", "default": 0.7, "description": "IoU threshold for positive RPN anchors." },
"rpn_negative_iou_threshold": { "type": "number", "default": 0.3, "description": "IoU threshold for negative RPN anchors." },
"rpn_min_pos_iou": { "type": "number", "default": 0.3, "description": "Min IoU for best-anchor-per-GT to be positive (MMRotate RPN)." },
"rpn_match_low_quality": { "type": "boolean", "default": true, "description": "Force best anchor per GT to positive when IoU >= rpn_min_pos_iou." },
"use_hbb_for_matching": { "type": "boolean", "default": false, "description": "Use axis-aligned (HBB) IoU for RPN/anchor matching (MMRotate RPN stage)." },
"roi_use_hbb_for_matching": { "type": "boolean", "default": false, "description": "Oriented R-CNN only: use HBB IoU for ROI-stage matching. Default false (rotated IoU, MMRotate RCNN)." },
"add_gt_as_proposals": { "type": "boolean", "default": true, "description": "Append GT boxes to RPN proposals in training (MMRotate default)." },
"final_nms_iou_threshold": { "type": "number", "default": 0.5, "description": "Final detection NMS IoU threshold after ROI head (distinct from rpn_nms_threshold)." },
"nms_class_agnostic": { "type": "boolean", "default": false, "description": "If true, run one oriented NMS on all classes (suppresses overlapping car/truck); if false, NMS per class (default)." },
"final_nms_use_cpu": { "type": "boolean", "default": false, "description": "If true, final detection oriented NMS uses exact polygon IoU on CPU (slower; ignores GPU sampling NMS and ORIENTED_DET_ROTATED_BACKEND for that step only)." },
"final_nms_iou_schedule_epochs": { "type": ["array", "null"], "items": { "type": "integer" }, "description": "Epoch boundaries for final detection NMS IoU schedule (same parameter as final_nms_iou_threshold)." },
"final_nms_iou_schedule_values": { "type": ["array", "null"], "items": { "type": "number" }, "description": "Final NMS IoU values per segment." },
"max_detections_per_image": { "type": "integer", "default": 100, "description": "Max detections to keep per image after final NMS." },
"inference_pre_nms_score_threshold": { "type": "number", "default": 0.05, "description": "Pre-NMS score threshold for detection candidates." },
"roi_inference_top_class_only": { "type": "boolean", "default": false, "description": "Two-stage ROI inference: if true, argmax foreground class per proposal (MMRotate-style); if false, keep every class above inference_pre_nms_score_threshold. Prefer false early in training; true for late fine-tune and deployment." }
}
},
"training": {
"type": "object",
"description": "Training hyperparameters. Keys: lr_scheduler_type (switch) first, then lr_* grouped, then rest.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"lr_scheduler_type": { "type": ["string", "null"], "description": "LR scheduler: null/'multistep'/'step' = MultiStepLR/StepLR; 'reduce_on_plateau' = ReduceLROnPlateau; 'one_cycle' = OneCycleLR (per-step); 'cosine_annealing'/'cosine' = PyTorch CosineAnnealingLR (SGDR restarts if num_epochs > T_max); 'cosine_annealing_with_tail'/'cosine_with_tail' = cosine phase then fixed tail_lr; 'cosine_annealing_late'/'cosine_late' = flat base LR until lr_scheduler_cosine_start_epoch, then cosine to eta_min by num_epochs; 'linear'/'linear_decay' = linear decay from learning_rate to learning_rate * lr_scheduler_linear_end_factor." },
"lr_scheduler_step_epochs": { "type": "integer", "default": 8, "description": "StepLR period in epochs (LR *= gamma every N epochs). Distinct from lr_warmup_steps (optimizer steps)." },
"lr_scheduler_milestones": { "type": ["array", "null"], "items": { "type": "integer" }, "description": "Optional MultiStepLR milestones in epochs. When set, takes precedence over lr_scheduler_step_epochs." },
"lr_scheduler_gamma": { "default": 0.1, "description": "LR drop factor. Number: same factor at every StepLR/MultiStepLR drop. Array: one factor per lr_scheduler_milestones entry.", "oneOf": [ { "type": "number" }, { "type": "array", "items": { "type": "number" } } ] },
"lr_scheduler_plateau_metric": { "type": "string", "default": "total_loss", "description": "Metric to monitor for ReduceLROnPlateau. Use 'mAP' (mode=max) or 'total_loss' (mode=min)." },
"lr_scheduler_plateau_factor": { "type": "number", "default": 0.1, "description": "ReduceLROnPlateau: factor by which LR is multiplied when metric plateaus." },
"lr_scheduler_plateau_patience": { "type": "integer", "default": 5, "description": "ReduceLROnPlateau: number of epochs with no improvement before reducing LR." },
"lr_scheduler_one_cycle_pct_start": { "type": "number", "default": 0.3, "description": "OneCycleLR: fraction of total steps for warmup phase." },
"lr_scheduler_one_cycle_div_factor": { "type": "number", "default": 25.0, "description": "OneCycleLR: initial_lr = max_lr / div_factor." },
"lr_scheduler_one_cycle_final_div_factor": { "type": "number", "default": 1e4, "description": "OneCycleLR: min_lr = initial_lr / final_div_factor." },
"lr_scheduler_cosine_eta_min": { "type": "number", "default": 1e-6, "description": "Minimum LR at end of cosine phase (eta_min)." },
"lr_scheduler_cosine_epochs": { "type": ["integer", "null"], "minimum": 1, "description": "Cosine decay length in epochs (PyTorch CosineAnnealingLR T_max). With tail settings, num_epochs should equal cosine_epochs + tail_epochs. Legacy lr_scheduler_cosine_t_max remaps onto this key." },
"lr_scheduler_cosine_tail_epochs": { "type": "integer", "default": 0, "minimum": 0, "description": "Fixed-LR tail after cosine (0 = auto from num_epochs - cosine_epochs when longer)." },
"lr_scheduler_cosine_tail_lr": { "type": ["number", "null"], "description": "Constant LR during tail; default lr_scheduler_cosine_eta_min." },
"lr_scheduler_cosine_start_epoch": { "type": ["integer", "null"], "default": null, "description": "cosine_annealing_late: keep the base LR until this epoch (PyTorch last_epoch), then cosine to eta_min at num_epochs. Null uses num_epochs // 2." },
"lr_scheduler_linear_end_factor": { "type": "number", "default": 0.01, "minimum": 0, "description": "linear: final_lr = learning_rate * this factor (Ultralytics lrf). Default 0.01, so lr 0.01 ends at 1e-4." },
"lr_warmup_steps": { "type": "integer", "default": 500, "description": "Number of optimizer steps for linear warmup." },
"warmup_momentum": { "type": ["number", "null"], "default": null, "description": "SGD momentum at the first warmup step. Null leaves momentum unchanged. 0.8 ramps to momentum over lr_warmup_steps." },
"warmup_bias_lr": { "type": ["number", "null"], "default": null, "description": "Bias-group learning rate at the first warmup step. Null ramps every group from 0. Conv and head biases ramp from this value to their base LR over lr_warmup_steps. BatchNorm biases stay in the norm group and still ramp from 0." },
"lr_scaling_with_accumulation": { "type": "string", "enum": ["linear", "sqrt", "none"], "default": "linear", "description": "Scale base LR by effective batch size: linear, sqrt, or none." },
"lr_scale_with_world_size": { "type": "boolean", "default": false, "description": "If true, multiply base LR by DDP world size. MMRotate parity mode keeps this false." },
"use_lr_param_groups": { "type": "boolean", "default": false, "description": "If true, use per-module learning rate multipliers (backbone, RPN, ROI, RetinaNet head, other)." },
"lr_mult_backbone": { "type": "number", "default": 0.5, "description": "LR multiplier for backbone parameters." },
"lr_mult_rpn": { "type": "number", "default": 0.5, "description": "LR multiplier for RPN head (ignored for rpn_head.* when lr_mult_head is set)." },
"lr_mult_roi": { "type": "number", "default": 2.0, "description": "LR multiplier for ROI head (ignored for roi_head.* when lr_mult_head is set)." },
"lr_mult_other": { "type": "number", "default": 1.0, "description": "LR multiplier for other parameters." },
"lr_mult_head": { "type": ["number", "null"], "default": null, "description": "Optional LR multiplier for head.* (RetinaNet). When set, rpn_head.* and roi_head.* use the same multiplier (single knob for detector heads); when null, head.* uses lr_mult_other and two-stage heads use lr_mult_rpn / lr_mult_roi." },
"num_epochs": { "type": "integer", "default": 20, "minimum": 1, "description": "Number of training epochs." },
"learning_rate": { "type": "number", "default": 0.001, "description": "Base learning rate (scaled by gradient accumulation / world size when configured)." },
"optimizer": { "type": "string", "enum": ["sgd", "adamw"], "default": "sgd", "description": "Optimizer. sgd uses momentum. adamw uses adamw_betas (default 0.9, 0.999)." },
"momentum": { "type": "number", "default": 0.9, "description": "SGD momentum." },
"nesterov": { "type": "boolean", "default": false, "description": "SGD Nesterov momentum. Requires momentum > 0." },
"weight_decay": { "type": "number", "default": 0.0001, "description": "Weight decay (L2)." },
"adamw_betas": { "type": ["array", "null"], "items": { "type": "number" }, "minItems": 2, "maxItems": 2, "description": "AdamW betas. Null uses (0.9, 0.999)." },
"weight_decay_norm_mult": { "type": "number", "default": 1, "description": "Multiplier on weight_decay for BatchNorm/GroupNorm weight and bias. 1 leaves decay unchanged. 0 disables it." },
"weight_decay_bias_mult": { "type": "number", "default": 1, "description": "Multiplier on weight_decay for biases that are not part of a norm layer. 1 leaves decay unchanged. 0 disables it. Conv weights keep weight_decay." },
"norm_bias_in_bias_group": { "type": "boolean", "default": false, "description": "False keeps BatchNorm/GroupNorm biases in the norm group. True moves them to the bias group, as Ultralytics and MMYOLO do, so warmup_bias_lr and weight_decay_bias_mult apply to them. Norm weights stay in the norm group." },
"use_ema": { "type": "boolean", "default": false, "description": "Track ExpMomentumEMA weights. Validation and best_mAP checkpoints use the EMA copy. checkpoint_epoch_*.pth still stores raw weights plus ema_state_dict." },
"ema_momentum": { "type": "number", "default": 0.0002, "description": "Late EMA mix coefficient on the live weights (m in (1-m)*exp(-(1+t)/gamma)+m)." },
"ema_gamma": { "type": "number", "default": 2000, "description": "EMA warmup gamma. Early steps track the live weights; later steps use ema_momentum." },
"use_amp": { "type": "boolean", "default": true, "description": "Mixed precision (FP16) training." },
"gradient_accumulation_steps": { "type": "integer", "default": 2, "minimum": 1, "description": "Accumulate gradients over this many steps; effective batch = batch_size × this." },
"max_grad_norm": { "type": ["number", "null"], "default": 1.0, "description": "Max gradient norm. Null disables clipping." },
"freeze_backbone_epochs": { "type": "integer", "default": 0, "minimum": 0, "description": "While training loop epoch index epoch < N (0-based), freeze backbone.* (requires_grad=False). ROI head still trains. 0 = disabled." },
"freeze_rpn_epochs": { "type": "integer", "default": 0, "minimum": 0, "description": "While epoch < N, freeze rpn_head.* on two-stage detectors. No-op without rpn_head (e.g. RetinaNet). 0 = disabled." },
"loss_weights": { "type": ["object", "null"], "additionalProperties": { "type": "number" }, "description": "Per-loss weights, e.g. { \"loss_box_reg\": 0.5 } to stabilize ROI head." },
"early_stop_patience": { "type": ["integer", "null"], "default": null, "description": "If set, stop training after this many epochs without improvement on early_stop_metric (null = disabled)." },
"early_stop_metric": { "type": "string", "default": "mAP", "description": "Validation metric key for early stopping (e.g. mAP). Skips update when mAP was not computed (-1)." },
"early_stop_min_delta": { "type": "number", "default": 0, "description": "Minimum change to qualify as improvement for early stopping." },
"early_stop_higher_is_better": { "type": ["boolean", "null"], "default": null, "description": "If null, inferred from metric name (mAP/AP_* = higher)." }
}
},
"evaluation": {
"type": "object",
"description": "Evaluation settings.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"val_score_threshold": { "type": "number", "default": 0.3, "description": "Score floor for in-train val mAP, best_mAP, val_map_at_end, and make eval-val. Legacy aliases evaluation.score_threshold and evaluation.train_val_score_threshold are remapped on load." },
"val_per_class_score_threshold": {
"type": ["object", "null"],
"additionalProperties": { "type": "number" },
"description": "Optional class_name -> min score for the val pass; classes not listed use val_score_threshold. Legacy alias evaluation.per_class_score_threshold."
},
"val_map_every_n_epochs": { "type": "integer", "default": 0, "description": "If >0, compute val mAP every N epochs on the current model. 0 skips periodic mAP. Legacy alias evaluation.compute_map_every_n_epochs." },
"val_exact_rotated_iou": { "type": "boolean", "default": true, "description": "When true, periodic val mAP and GT-cover use exact CPU polygon IoU. When false, GPU sampling. Does not affect detection NMS. Legacy alias evaluation.use_exact_rotated_iou." },
"val_extended_gt_metrics": { "type": "boolean", "default": false, "description": "If true, compute GT–IoU histogram diagnostics on the val mAP schedule. Legacy alias evaluation.extended_gt_metrics." },
"val_map_at_end": { "type": "boolean", "default": false, "description": "If true, after training reload the best checkpoint and score val once more at val_score_threshold. Prefer test_map. Legacy alias evaluation.compute_map_final." },
"test_map": { "type": "boolean", "default": false, "description": "If true, after training score the configured test split once on the best checkpoint at test_score_threshold (null → 0.05). Does not choose the checkpoint. Requires a test split. DOTA test tiles are the leaky val tiles. Legacy aliases evaluation.compute_map_test and evaluation.compute_test_map." },
"test_score_threshold": { "type": ["number", "null"], "default": null, "description": "Score floor for test_map, make eval-test, and dota-submit. Null → 0.05. make eval-val uses val_score_threshold. Legacy alias evaluation.preds_score_threshold." },
"test_exact_rotated_iou": { "type": ["boolean", "null"], "default": null, "description": "IoU backend for test_map. Null uses val_exact_rotated_iou. Legacy alias evaluation.use_exact_rotated_iou_for_final_map." },
"iou_threshold": { "type": "number", "default": 0.5, "description": "IoU threshold for single-threshold mAP matching, and for GT-cover / accuracy when map_iou_thresholds is set. Not detection NMS." },
"map_iou_thresholds": { "type": ["array", "null"], "items": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 }, "default": null, "description": "When set, mAP is the mean of area-under-PR over these rotated-IoU thresholds (IoU matrix computed once). Null keeps 11-point AP at iou_threshold. OSSDD recipes set 0.10, 0.15, ..., 0.95. best_metric mAP uses this average. iou_threshold still drives GT-cover and the precision-recall operating point." },
"map_ap_interpolation": { "type": "string", "enum": ["all_point", "coco101"], "default": "all_point", "description": "AP integral per IoU threshold when map_iou_thresholds is set. all_point: VOC 2010 area under the precision-recall curve (DOTA / OSSDD). coco101: pycocotools, precision envelope read at 101 recall points, at most 100 detections per image and class, and classes without ground truth left out of the mean. The COCO recipe sets coco101 so the logged mAP matches COCOeval." },
"final_nms_iou_threshold": { "type": ["number", "null"], "default": null, "description": "Final detection NMS IoU for odet preds / make eval-val / make eval-test (MMRotate test parity). When set, overrides production.final_nms_iou_threshold on that path. Deploy / image_demo keep production.*; training val uses model.final_nms_iou_threshold." }
}
},
"production": {
"type": "object",
"description": "Production overrides (deploy, image_demo): score_threshold and per_class_score_threshold (merge with evaluation); mAP IoU is evaluation.iou_threshold only. Decode/NMS patch model in load_model_from_checkpoint / deploy / image_demo — not during tools/train.py. odet preds / make eval-val prefer evaluation.final_nms_iou_threshold when set. Sliding-window: overlap, margin, canvas. Null fields fall back to evaluation/model/dataset or deploy defaults.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"score_threshold": { "type": ["number", "null"], "default": null, "description": "When set, deploy / image_demo display floor (resolve_inference_score_threshold). Does not override val mAP (evaluation.val_score_threshold) or test mAP (evaluation.test_score_threshold, null → 0.05)." },
"per_class_score_threshold": {
"type": ["object", "null"],
"additionalProperties": { "type": "number" },
"description": "Per-class floors for preds/deploy only (merge_per_class_score_thresholds: evaluation then production). Does not affect train-val mAP."
},
"output_classes": {
"type": ["array", "null"],
"items": { "type": "string" },
"description": "Post-NMS class allowlist for odet preds, image_demo, deploy/Docker, and ONNX export (case-insensitive). Null = keep all. Prefer this over impossible score floors (e.g. 1.1) when hiding classes for a client — excluded classes still compete in NMS."
},
"final_nms_iou_threshold": { "type": ["number", "null"], "default": null, "description": "Deploy / image_demo final detection NMS IoU; when set, patches the live model after checkpoint load. odet preds / make eval-val use evaluation.final_nms_iou_threshold when that field is set." },
"final_nms_use_cpu": { "type": ["boolean", "null"], "default": null, "description": "When set, patches model.final_nms_use_cpu (exact polygon NMS on CPU)." },
"inference_pre_nms_score_threshold": { "type": ["number", "null"], "default": null, "description": "Decoder pre-NMS score floor; when set, patches model.inference_pre_nms_score_threshold (or RetinaNet score_threshold)." },
"max_detections_per_image": { "type": ["integer", "null"], "default": null, "description": "When set, patches model.max_detections_per_image." },
"nms_class_agnostic": { "type": ["boolean", "null"], "default": null, "description": "When set, patches model.nms_class_agnostic (two-stage, RetinaNet, and FCOS)." },
"roi_inference_top_class_only": { "type": ["boolean", "null"], "default": null, "description": "Two-stage only: when set, patches model.roi_inference_top_class_only." },
"rpn_pre_nms_top_n": { "type": ["integer", "null"], "default": null, "description": "When set, patches model.rpn_pre_nms_top_n (two-stage)." },
"rpn_post_nms_top_n": { "type": ["integer", "null"], "default": null, "description": "When set, patches model.rpn_post_nms_top_n (two-stage)." },
"rpn_nms_threshold": { "type": ["number", "null"], "default": null, "description": "When set, patches model.rpn_nms_threshold (two-stage proposal NMS)." },
"overlap_pixels": { "type": ["integer", "null"], "default": null, "description": "Sliding-window overlap in pixels per axis; null = 200 (same default as oriented_det.runtime.inference)." },
"ignore_margin_pixels": { "type": ["number", "null"], "default": null, "description": "Interior margin (px): drop detections whose centroid lies in the outer band; null = dataset.overlap/2 (0 disables)." },
"use_first_image_canvas": { "type": ["boolean", "null"], "default": null, "description": "Deploy: expand square canvas from first image (fixed resize); null = false." },
"stick_to_model_canvas": { "type": ["boolean", "null"], "default": null, "description": "Deploy: always use config target_size; null = true." }
}
},
"tensorboard": {
"type": "object",
"description": "TensorBoard and validation logging options.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"log_debug_anchors_proposals": { "type": "boolean", "default": false, "description": "Log val/debug_anchors and val/debug_proposals (random val image each epoch with RPN anchors and proposals overlaid). Only applies to RCNN-style models." },
"vis_score_threshold": { "type": ["number", "null"], "default": null, "description": "Min score for boxes in TensorBoard prediction images; null = use evaluation.val_score_threshold." }
}
},
"checkpoint": {
"type": "object",
"description": "Checkpoint loading and best-model saving.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"load_from_checkpoint": { "type": ["string", "null"], "description": "Path to checkpoint file (.pth), relative path under project root (e.g. pretrained/...), or hf://<asset> for Hugging Face Hub download when missing." },
"load_from_experiment": { "type": ["string", "null"], "description": "Path to experiment directory." },
"discover_previous_run": { "type": "boolean", "default": false, "description": "If true, when load_from_experiment is null and load_from_checkpoint does not point to an existing file, set load_from_experiment to the newest other run under runs/<model_type>/. If false, never auto-fill (scratch training unless paths are set)." },
"resume_from_checkpoint_epoch": { "type": "boolean", "default": true, "description": "When loading from an experiment dir: if true, use latest checkpoint_epoch_*.pth and continue training from that epoch (optimizer/scheduler per load_* flags). If false, prefer best_* checkpoint and usually start at epoch 0 with fresh optimizer unless overridden." },
"load_optimizer_state": { "type": "boolean", "default": true, "description": "When loading a checkpoint, restore optimizer state if present." },
"load_scheduler_state": { "type": "boolean", "default": true, "description": "When resume_from_checkpoint_epoch is true, restore LR scheduler state from checkpoint if true. Set false with lr_warmup_steps=0 to rebuild cosine (see tools/train.py continuation path)." },
"start_epoch": { "type": "integer", "default": 0, "description": "Epoch index to start from (overridden when resuming)." },
"best_metric": { "type": "string", "default": "total_loss", "description": "Metric used to save the best checkpoint. Use 'mAP' to save at best validation mAP, or 'total_loss' to save at lowest loss. evaluation.test_map and evaluation.val_map_at_end score that checkpoint." },
"higher_is_better": { "type": ["boolean", "null"], "default": null, "description": "If true, higher metric value is better (e.g. mAP). If false, lower is better (e.g. total_loss). If null, inferred from best_metric ('mAP' -> true, else false)." },
"load_include_prefixes": { "type": ["array", "null"], "items": { "type": "string" }, "description": "When loading checkpoint: load only weights whose key starts with one of these prefixes. null = no filter." },
"load_exclude_prefixes": { "type": ["array", "null"], "items": { "type": "string" }, "description": "When loading checkpoint: do not load weights whose key starts with one of these prefixes. null = no filter." }
}
},
"loss": {
"type": "object",
"description": "Loss configuration. Keys: loss_type (switch) first, then rest.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"loss_type": { "type": "string", "enum": ["cross_entropy", "class_weighted", "focal", "focal_weighted", "none"], "default": "class_weighted", "description": "Experiment-level classification loss: cross_entropy = plain ROI CE (two-stage), class_weighted = ROI CE with dataset-derived weights, focal = unweighted focal (ROI or FCOS/RetinaNet sigmoid focal), focal_weighted = same focal plus dataset-derived class weights (ROI heads and FCOS/RetinaNet per-class column scales), none = legacy fallback to model.roi_loss_type." },
"class_weight_method": { "type": "string", "enum": ["sqrt", "inv_freq", "effective_num", "log_inv_freq"], "default": "sqrt", "description": "How to compute class weights from counts." },
"class_weight_beta": { "type": "number", "default": 0.9999, "description": "effective_num only: beta parameter close to 1.0 for smoother weights." },
"class_weight_schedule_type": { "type": ["string", "null"], "default": null, "enum": [null, "linear_ramp"], "description": "Optional schedule for class weights (ROI heads and FCOS/RetinaNet sigmoid focal). When set to 'linear_ramp', weights ramp from uniform -> computed weights between start/end epochs." },
"class_weight_schedule_start_epoch": { "type": "integer", "default": 0, "description": "Schedule start epoch (inclusive) for class weight ramp." },
"class_weight_schedule_end_epoch": { "type": "integer", "default": 0, "description": "Schedule end epoch (inclusive-ish). Must be > start_epoch to enable ramp." },
"class_weight_schedule_power": { "type": "number", "default": 1.0, "description": "Ramp exponent: 1.0 linear, >1 delays the effect (eases in), <1 speeds it up." },
"background_weight": { "type": ["number", "null"], "default": null, "description": "Optional weight override for background class (index 0) in the two-stage ROI classifier. Ignored by FCOS/RetinaNet one-hot sigmoid focal (no background class)." },
"focal_alpha": { "type": "number", "default": 1.0, "description": "Focal loss alpha (when loss_type is focal or focal_weighted)." },
"focal_gamma": { "type": "number", "default": 2.0, "description": "Focal loss gamma (when loss_type is focal or focal_weighted)." },
"class_weight_overrides": { "type": ["object", "null"], "additionalProperties": { "type": "number" }, "description": "Optional per-class weight overrides, e.g. {\"truck\": 0.25} to reduce dominant-class bias." },
"label_smoothing": { "type": "number", "default": 0, "minimum": 0, "maximum": 1, "description": "Label smoothing for ROI classification (e.g. 0.1)." },
"roi_grouped_ce_enabled": { "type": "boolean", "default": false, "description": "When true, use coarse-to-fine grouped cross-entropy on the ROI classifier (single-run curriculum)." },
"roi_grouped_ce_groups": { "type": ["object", "null"], "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "Maps group name to class names, e.g. {\"plane\": [\"Bomber Aircraft\", \"Fighter Aircraft\", ...]}." },
"roi_grouped_ce_schedule_type": { "type": ["string", "null"], "default": null, "enum": [null, "step", "linear_ramp"], "description": "Grouped CE mix schedule: step = grouped until end_epoch then fine CE; linear_ramp = blend grouped→fine from start to end epoch." },
"roi_grouped_ce_schedule_start_epoch": { "type": "integer", "default": 0, "description": "Grouped CE schedule start epoch (linear_ramp)." },
"roi_grouped_ce_schedule_end_epoch": { "type": "integer", "default": 8, "description": "Grouped CE schedule end epoch (step: first fine epoch; ramp: last grouped-heavy epoch)." },
"roi_grouped_ce_schedule_power": { "type": "number", "default": 1.0, "description": "Ramp exponent for linear_ramp (1.0 = linear)." }
}
},
"preprocessing": {
"type": "object",
"description": "Image preprocessing. Keys: resize_mode (switch) first, then target_size, window_size, normalize_*, pad_*, enable_flip_*, enable_random_rotate / random_rotate_*.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"resize_mode": { "type": "string", "default": "fixed", "description": "\"fixed\" = stretch to (H,W); \"pad\" = uniform scale so longer edge equals max(H,W) then zero-pad to target_size; \"keep_ratio\" = same scale without square pad (then pad_size_divisor; MMRotate RResize+Pad); \"crop\" = native-res crop/pad to (H,W)." },
"target_size": { "type": "array", "items": { "type": "integer" }, "minItems": 1, "maxItems": 2, "description": "[H, W] canvas for fixed/pad/crop, or [size] for square canvas (pad/crop). The tensor the network receives." },
"window_size": { "type": ["array", "null"], "items": { "type": "integer" }, "minItems": 1, "maxItems": 2, "default": null, "description": "Optional sliding-window slice [H, W] in source pixels for fixed/crop inference. The network still receives target_size; each slice is bilinear-resized onto that canvas. Per-axis scale is target_size / window_size. Null keeps the slice equal to target_size and does not resize crops. pad and keep_ratio ignore this field." },
"normalize_mean": { "type": "array", "items": { "type": "number" }, "description": "RGB mean for normalization ([0,1] scale). Default: MMDetection-style." },
"normalize_std": { "type": "array", "items": { "type": "number" }, "description": "RGB std for normalization ([0,1] scale)." },
"pad_size_divisor": { "type": "integer", "default": 32, "description": "Pad image to multiple of this (training)." },
"enable_flip_horizontal": { "type": "boolean", "default": true, "description": "Allow a random horizontal flip during training. Applied independently with probability flip_prob." },
"enable_flip_vertical": { "type": "boolean", "default": true, "description": "Allow a random vertical flip during training. Applied independently with probability flip_prob." },
"enable_flip_diagonal": { "type": "boolean", "default": false, "description": "Allow a random diagonal flip (point reflection; MMRotate RRandomFlip direction=diagonal). Applied independently with probability flip_prob. Horizontal then vertical is the same geometry." },
"flip_prob": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1, "description": "Probability of applying each enabled flip independently. With horizontal and vertical enabled, 0.5 yields 25% none, 25% horizontal, 25% vertical, and 25% both." },
"enable_random_rotate": { "type": "boolean", "default": false, "description": "Apply MMRotate-style PolyRandomRotate after flips during training (train only). FCOS HRSC 1×/3× and Oriented R-CNN / Faster R-CNN HRSC 3× use p=0.5 ±20°." },
"random_rotate_prob": { "type": "number", "default": 0.5, "description": "Probability of applying a random rotate when enable_random_rotate is true." },
"random_rotate_angle_range": { "type": "number", "default": 180, "description": "Half-range in degrees. Angle is sampled uniformly from [-range, +range]. FCOS HRSC uses 20; MMRotate RR recipes use 180." },
"random_rotate_rect_labels": { "type": ["array", "null"], "items": { "type": "string" }, "description": "Class names whose tiles rotate only by 90, 180, -90, or -180 degrees when random rotate fires. Other tiles use random_rotate_angle_range." },
"enable_mosaic": { "type": "boolean", "default": false, "description": "Train-only cached mosaic (four tiles on a 2× canvas, then resize-crop to target_size)." },
"mosaic_prob": { "type": "number", "default": 1, "description": "Probability of composing a mosaic once the cache holds more than four images." },
"mosaic_img_scale": { "type": ["array", "null"], "items": { "type": "integer" }, "description": "Cell size (H, W) of one mosaic tile. Null uses target_size." },
"mosaic_center_ratio_range": { "type": ["array", "null"], "items": { "type": "number" }, "description": "Random mosaic center as a fraction of the cell size. Null uses [0.5, 1.5]." },
"mosaic_pad_val": { "type": "integer", "default": 114, "description": "Fill value for mosaic canvas and per-tile rotate." },
"mosaic_max_cached_images": { "type": "integer", "default": 40, "minimum": 5, "description": "Worker-local mosaic cache length. Must be at least 5." },
"mosaic_ratio_range": { "type": ["array", "null"], "items": { "type": "number" }, "description": "Random resize ratio applied to the 2× mosaic canvas before cropping back to target_size. Null uses [0.5, 1.5]." },
"mosaic_min_visibility": { "type": "number", "default": 0.2, "minimum": 0, "maximum": 1, "description": "Drop a mosaic box when less than this fraction of its area remains inside the canvas. 0.2 drops a box once more than 80% of it is outside the crop. The same fraction drops a box after random scale and translate." },
"mosaic_clip_boxes": { "type": "boolean", "default": false, "description": "Cut axis-aligned boxes (angle 0 or ±90°) to the canvas at the mosaic, affine, and scale/translate stages instead of keeping the full extent, as Ultralytics does. Rotated boxes are never cut. Combine with mosaic_min_visibility 0.1 for the Ultralytics rule. Off for DOTA." },
"mosaic_disable_last_n_epochs": { "type": "integer", "default": 0, "minimum": 0, "description": "Turn mosaic off for the last N epochs (0 keeps it on for the whole run)." },
"random_scale": { "type": "number", "default": 0, "minimum": 0, "description": "Train-only scale gain. 0.5 draws a uniform factor in [0.5, 1.5] about the canvas center, then crops or pads back to target_size. 0 disables it. Validation does not apply it." },
"random_translate": { "type": "number", "default": 0, "minimum": 0, "description": "Train-only translation gain. 0.1 shifts by up to 10% of the canvas on each axis after random scale. 0 disables it. Validation does not apply it." }
}
},
"augmentation": {
"type": "object",
"description": "Albumentations (non-geometric). Keys: limits first, then p_* (probabilities). Only used when enable_albumentation is true.",
"patternProperties": {
"^_muted_": true
},
"additionalProperties": false,
"properties": {
"brightness_limit": { "type": "number", "default": 0.2, "description": "Range for brightness/contrast shift (Albumentations)." },
"contrast_limit": { "type": "number", "default": 0.2, "description": "Range for contrast shift (Albumentations)." },
"gamma_limit": { "type": "array", "items": { "type": "integer" }, "minItems": 2, "maxItems": 2, "description": "[min, max] gamma for gamma transform." },
"gauss_noise_var_limit": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2, "description": "[min, max] variance for Gaussian noise." },
"blur_limit": { "type": "integer", "default": 3, "description": "Max kernel size for blur." },
"clahe_clip_limit": { "type": "number", "default": 4.0, "description": "CLAHE clip limit." },
"hsv_h": { "type": "number", "default": 0.015, "minimum": 0, "description": "Hue gain fraction (Ultralytics hsv_h): hue index × (1 ± U(0, hsv_h)), wrapped modulo 180. 0.015 moves hue by at most 2.7 of 180. Multiplicative, not an additive shift." },
"hsv_s": { "type": "number", "default": 0.7, "minimum": 0, "description": "Saturation gain fraction (Ultralytics hsv_s): saturation × (1 ± U(0, hsv_s)), clipped to 255." },
"hsv_v": { "type": "number", "default": 0.4, "minimum": 0, "description": "Value gain fraction (Ultralytics hsv_v): value × (1 ± U(0, hsv_v)), clipped to 255." },
"p_brightness_contrast": { "type": "number", "default": 0.5, "description": "Probability of brightness/contrast transform." },
"p_gamma": { "type": "number", "default": 0.3, "description": "Probability of gamma transform." },
"p_noise": { "type": "number", "default": 0.2, "description": "Probability of Gaussian noise." },
"p_blur": { "type": "number", "default": 0.2, "description": "Probability of blur." },
"p_clahe": { "type": "number", "default": 0.3, "description": "Probability of CLAHE." },
"p_hsv": { "type": "number", "default": 0, "minimum": 0, "maximum": 1, "description": "Probability of HSV jitter. 0 leaves other recipes unchanged." }
}
},
"enable_albumentation": { "type": "boolean", "default": false, "description": "Enable Albumentations (non-geometric) augmentation pipeline." },
"enable_profiling": { "type": "boolean", "default": false, "description": "Enable training step profiler (TensorBoard trace)." }
}
}