Design Archive
中EN

(3) A new detection head

National Medical Insurance Imaging AI Contest, preliminary round, part 3: Local fixes had stalled, so we kept the RAD41 backbone and switched to a dense detection head that learns per anchor. The platform total rose from 39.31 to 47.78. This step changed the architecture, supervision, candidate generation and training budget at once, so the gain cannot be credited to any one change.

L.03 / 14
CATEGORY
Study
YEAR
2026
STATUS
Note
TOOLS
pytorch / rad-dino / retinanet

entryWrite-up

The ROI version settled on in the previous note scored 39.31 on platform validation. Its detection head classified the whole image and output at most one box per class, so candidates were sparse. The last few rounds of the previous note re-ranked existing candidates and changed the decoding, and none of them fixed the missed findings; further re-ranking of the same candidates was unlikely to fix them either. This note starts with replacing the detection head and runs up to 23 September.

Global classification and sparse candidates were limiting detection, so established detection architectures were worth comparing. At first there was an implementation plan to switch to YOLO, a public, established detector, but it was withdrawn: we were entered in the in-house model group and required that our own RAD41 core stay; replacing the backbone would still have to meet the contest’s compliance requirements for the core model, and the YOLO route never got a specific compliance ruling. YOLO stayed at the planning stage and was never loaded or trained. That left two options, local dense detection and reclassifying the existing candidate boxes; the latter could not recover findings missed outside the old candidates, so it was put on hold and local dense detection was chosen. The choice rested on mechanism and engineering cost; it did not prove that local dense detection would raise the score. In practice, we froze the backbone of the T3 model that had already scored 39.31 on the platform and attached a randomly initialized neck plus the off-the-shelf RetinaNetHead structure from torchvision, using the structure only and loading no external detection pretrained weights.

To widen candidate coverage, and to test whether multi-scale features added anything, the experiment compared two detection heads. Because the backbone was frozen, the features for the 518 input were computed once and cached, and both heads read the same features: single used only the one feature level the backbone outputs (single-scale); pyramid also built one finer and one coarser level through upsampling and pooling (multi-scale). The neck and head parts the two shared started from the same random initial weights. The new head places a set of anchors on every cell of the feature map, and each anchor learns 17 class scores and one class-agnostic box position at the same time, replacing the old per-class top-1. Both were trained for 20 epochs on the same training set; a numerical issue came up partway through, was fixed, and training resumed within the original budget. The comparison was made at epoch 20, fixed in advance, without going back to pick the best epoch. This round changed the architecture, supervision, candidate generation and training budget at once, so score changes cannot be credited to the head structure alone.

We compared the original model, single and pyramid on the same 1,396-case dev set, looking at detection, downstream tasks and resource cost. These 1,396 cases were used repeatedly to compare options; they are not an independent test set. The dev-set ground truth was updated partway through; on the current ground truth, mAP17 for the three was 0.087006, 0.165304 and 0.166123. The 95% interval for pyramid minus single, from resampling by case, crossed 0, and that interval was computed on an earlier, frozen version of the ground truth (numbers from the two versions cannot be mixed); on that basis we could neither say pyramid was better nor that the two were equivalent. On the downstream side, single matched 166 effusions to pyramid’s 142, and single also had the higher effusion AUC and the simpler structure, so single went into the full service first. The current evidence is not enough to confirm any extra gain from pyramid.

A dev-set improvement still had to be checked in the full service. T4 gives mass diameter and effusion grade from T3’s boxes, and T5 reuses T3’s boxes and T4’s attributes. We completed the single service, the T4 and T5 integration, cold start and the platform callback, with the original T1 and T2 safety components carried over. The platform total rose from 39.31 to 47.78, up 8.47; T3, T4 and T5 all went up, T4 by 5.28 even though it was not retrained this time, since what changed was the detection boxes upstream of it; safety stayed at 19.80. Single became the new baseline. Some T4 sub-scores still dropped. Two aggregate scores are not enough to credit the whole gain to any one structural change.

With single now detecting lesions, the next step was to make classification scores track box localization quality more closely. The experiment continued training from single’s epoch-20 weights for 5 epochs and switched the classification loss to QFL (quality focal loss, a classification loss with IoU as a soft target): for positives the target is the IoU between the predicted box and the ground-truth box (GT), with no gradient passed back through that IoU; for negatives the target is 0; the box regression loss stayed as before. The quality target is computed only during training and the inference structure is the same as single’s, so this is a different method from the quality re-ranking applied to the old ROI model in the previous note. Evaluated on the same 1,396-case dev set with the current ground truth, single scored 0.165304, a control continued for the same 5 epochs scored 0.163151, and quality scored 0.168484. Quality was kept; for now the improvement exists only on the dev set, with no platform score yet.

Shrinking the whole image straight to the 518 input may limit detection of small lesions, so to keep more of the original detail we tried full image plus four corner crops. Each case used the full image and four corner crops, each covering 60% of the original width and height, which meant 5 RAD41 forward passes per case; annotations cut by a crop were set to ignore, and training ran for a fixed 5 epochs. Training took 32.46 hours, and dev-set mAP17 was 0.167100, above single and below quality; Nodule improved and Mass dropped. The follow-up quantification and localization validation was stopped, and the results were kept on record. This conclusion applies only to this particular tiling recipe.

As of 23 September, the platform baseline was single at 47.78; quality was waiting for full-service validation on 27 September; the full image plus four corner crops recipe was not adopted.

processBefore & after

Platform validation total

ROI · 09-1639.31
single · 09-2147.78
quality · 09-2747.85
E-QH · 09-2848.01
re-run · 09-3048.01

Breakdown: ROI → single

T1 + T2 safety
19.80 → 19.80
T3 detection
1.92 → 4.65 · +2.73
T4 attributes
10.44 → 15.72 · +5.28
T5 localization
7.15 → 7.61 · +0.46

Dev-set mAP17 (1,396 cases)

Original
0.087006
single
0.165304 · adopted
pyramid
0.166123
Fine-tune control
0.163151
quality
0.168484 · adopted
Full image + corners
0.167100 · dropped

Training setup (single / pyramid)

Training set
11,242 cases
batch · optimizer
8 · AdamW 1e-4
Training budget
20 epochs · 28,120 updates

resultTakeaways

Finding
The single head scored 47.78 on platform validation, 8.47 above the ROI version: T3 +2.73, T4 +5.28, T5 +0.46, safety unchanged at 19.80. Quality fine-tuning for 5 more epochs then raised dev-set mAP17 from 0.165304 to 0.168484.
Parameters
Frozen RAD41 backbone · 518 input · neck 128 · 9 anchors per cell · 17-class sigmoid · class-agnostic box regression · batch 8 · AdamW 1e-4 · 20 epochs
Open
Pyramid scored slightly higher dev-set mAP17 than single, but the 95% interval of the difference crosses 0, so the extra gain cannot be confirmed. T4 was not retrained this time, and some of its sub-scores still dropped.

logChangelog

2026-09-19
Dropped the YOLO plan; kept RAD41 and built a dense detection head
2026-09-20
Trained single and pyramid for 20 epochs each; integrated single first
2026-09-21
Single on platform validation: 47.78 (+8.47)
2026-09-21
Quality fine-tuning for 5 epochs, mAP17 0.168484
2026-09-23
Full image plus four corner crops, 32.46 hours of training, dropped

Related experiments

note
L.01(STUDY)2026

(1) Choosing a base model

chest-xraypytorchrad-dino+1
note
L.02(STUDY)2026

(2) A first working build

chest-xraypytorchrad-dino
note
L.04(STUDY)2026

(4) Recipes that missed the adoption bar

chest-xraypytorchretinanet
← LabL.03 / 14
1 / 1

100%