Drones that detect vehicles around the clock often carry two cameras: an ordinary color camera and a thermal camera that sees heat. Current detectors combine the two with a learned fusion gate, a small network that decides at each pixel how much to trust each camera. We argue that this gate is trained by the wrong examples. In aerial scenes, more than 99.9% of pixels are background, and among the objects, common cars far outnumber rare classes such as vans and freight cars. The gate therefore learns which camera makes asphalt and ordinary cars easy to classify. The rare classes are exactly the ones that need the color camera's surface texture, because thermal images show a warm blob without the cues that separate a van from a car. At night, a gate trained mostly on background and cars learns to lean on thermal. That suits cars and fails the rare classes.
The proposal is to train the gate separately from the detector's main loss. It is supervised only inside object footprints. Its target at each object comes from a measurement of which camera actually helped detect that object. The supervision is normalized so that every class, and every object regardless of pixel size, contributes equally. If the hypothesis is right, the gains should concentrate on rare classes under poor illumination. They should not be reproducible by simply reweighting the detector's loss. They should vanish on a single-class dataset, which serves as a built-in control.
Core Claim
The claim has two parts. The first is diagnostic: in gated RGB-thermal detectors, the gate's modality choice on rare-class objects at night disagrees with which modality actually reduces their detection loss more often than it does for common classes. The second is constructive: fixing where the gate's training signal comes from, rather than how the detection loss weights classes, closes most of that disagreement and improves rare-class accuracy.
This idea sits at the intersection of all four directions. The day-night gap supplies the regime in which modality reliability flips. Small objects and extreme spatial imbalance supply the reason the gate's gradient is dominated by background. Cross-modal fusion is the mechanism we change.
Relation to Prior Work
The closest work is EGM-Det. It computes entropy priors from the raw RGB and thermal inputs to drive a per-pixel spatial-channel gate. It also distills a modality-preference target from two single-camera teachers, and it weights its loss by gate uncertainty. EGM-Det already teaches the gate a modality preference, so our novelty is not "supervise the gate." It is the allocation of that supervision. EGM-Det's preference and uncertainty signals are applied over the image with standard detection objectives and no class or area balancing; the research file notes it does not address spatial class imbalance or long-tail categories. We restrict gate supervision to object footprints and balance it by class and by object, and we test whether this matters.
Three earlier systems motivate the problem. UA-CMDet introduced DroneVehicle. It uses illumination- and cross-modal-IoU-based uncertainty weights, with separate RGB, thermal, and fused heads, and it explicitly reports weak results on the rare freight-car class. MBNet frames day versus night as a "modality imbalance" and balances the two cameras from a global illumination estimate. It works at pedestrian scale on driving data, and its balance is image-level rather than tied to object class. SuperYOLO keeps early resolution for tiny targets and adds a training-only super-resolution branch, but fuses the cameras with static channel attention. We reuse UA-CMDet's single-camera heads as the instrument that measures per-object modality utility, which is a role it did not give them.
The class-imbalance literature supplies our normalization logic. Dice-style losses (Dong et al.) normalize by foreground size rather than image size, so background cannot dilute the gradient. Gradient-Aware losses show that tail classes absent from many training crops produce vanishing gradients. They lift tiny Synapse organs from "0% DSC" to "between 27% and 51%". Attention Gated Networks use deep features to suppress background in skip connections. All three operate on single-modality medical scans and apply balancing to the task loss. We apply the same normalization to a different quantity: the training signal of the gate that chooses between sensors.
Single-camera night adaptation, such as DAI-Net with its Retinex-based decomposition and NightAdapter with its frequency-band adapter, constrains the design rather than supplying it. Once the color camera receives almost no light, no decomposition can recover missing texture. This is why a second sensor and a correct per-object choice between sensors matter.
Research Program
We start from a two-stream detector with a per-pixel gate $g(p)\in[0,1]$, the weight on RGB features at location $p$, with $1-g(p)$ on thermal. We attach lightweight RGB-only and thermal-only auxiliary heads, following UA-CMDet's triple-head design. For each ground-truth object $o$, these heads give losses $\ell_{\text{RGB}}(o)$ and $\ell_{\text{IR}}(o)$. We smooth them with an exponential moving average across epochs, because single-step losses on rare objects are noisy. The per-object utility target is
$$t_o = \sigma\big((\ell_{\text{IR}}(o) - \ell_{\text{RGB}}(o))/\tau\big),$$
where $\sigma$ is the logistic function and $\tau$ is a temperature. The target $t_o$ approaches 1 when the color camera detects $o$ better.
The gate is trained with
$$\mathcal{L}_{\text{gate}} = \frac{1}{|C|}\sum_{c\in C}\frac{1}{N_c}\sum_{o\in c}\frac{1}{|M_o|}\sum_{p\in M_o}\mathrm{BCE}\big(g(p),\,t_o\big),$$
where $C$ is the set of classes present in the batch, $N_c$ is the number of class-$c$ objects in the batch, and $M_o$ is the set of feature-map locations inside object $o$'s box. The class and object normalizations play the role Dice normalization plays in segmentation. Background pixels receive only a weak smoothness term.
To keep the rare classes' signal from disappearing on tiles that contain none of them, we borrow the absent-class problem identified by Gradient-Aware losses. We keep a small per-class memory of recent object features and targets and replay them into $\mathcal{L}_{\text{gate}}$.
The main design choice we test is whether the detection loss may also update the gate or is blocked by a stop-gradient. Blocking isolates the claim, because then only the balanced signal shapes the gate. Gate computation stays at the stride levels the detector already uses for small objects, so there is no new quadratic attention cost.
The diagnostic comes first and gates the rest of the project. On a trained baseline gated detector, we measure per-class agreement between $g$ averaged over each object and its utility target $t_o$, stratified by illumination. If rare-class agreement at night is not worse than car agreement, the core hypothesis is false and we stop.
Baselines
The naive reference point is a two-stream detector that concatenates RGB and thermal features before the feature pyramid. It is trained with the same backbone, input resolution, schedule, and augmentation as every other system. Alongside it we train RGB-only and thermal-only versions of the same detector. On DroneVehicle, UA-CMDet reports "47.91% mAP" for RGB-only and "59.15% mAP" for infrared-only, against "64.01% mAP" for its fused model (UA-CMDet). Our re-runs should land in that ordering, which checks the pipeline.
The strongest existing method is EGM-Det. It reports "71.4% mAP50-95" on its refined DroneVehicle, "60.3% mAP50-95" on VEDAI, and "64.2% mAP50-95" on LLVIP (EGM-Det). Because the DroneVehicle refinement and the code may not be available, we will reimplement its entropy-guided gate and selective distillation inside our shared codebase. We will report both our reproduced number and the published one. Our method is then applied as a change to EGM-Det's gate supervision, with an identical tuning budget: the same number of hyperparameter trials, swept over learning rate and loss weights for each method. Beating it means a statistically reliable gain, over three seeds, in mean AP over the rare classes at low illumination, without losing more than a fraction of a point in overall mAP50-95. On VEDAI we also report mAP50 against SuperYOLO's "75.09% mAP50" (SuperYOLO). The file gives no per-class rare-category AP for any method on DroneVehicle, and no reported result was found on Lacuna for freight-car AP under night conditions, so rare-class comparisons rely entirely on our re-runs.
Two imbalance-aware baselines apply standard fixes to the task loss of the same EGM-Det-style detector. The first is focal-style classification loss combined with class-frequency reweighting and rare-class oversampling of tiles. The second is Gradient-Aware cross-entropy with top-k hard mining from GA Loss, adapted to the detection classifier.
The key ablations are as follows. Our gate loss with the class and object normalizations removed tests whether balancing, not footprint supervision alone, matters. Our gate loss with the stop-gradient removed tests whether the detection loss pulls the gate back toward background-dominated behavior. Finally, the same per-class weights are applied to the detection loss instead of the gate, which separates "where the gate learns from" from "how classes are weighted."
Why not just…?
Why not just rebalance the detection loss with focal loss, class weights, or oversampling? This is the most serious threat. Oversampling tiles that contain rare vehicles will raise their share of gradient everywhere, including in the gate. The Gradient-Aware results suggest static weighting fails when rare classes are missing from most crops. That evidence comes from medical patches, though, not drone tiles. The ablation that moves identical per-class weights from the gate to the detection loss settles the question directly. If task-loss rebalancing matches our rare-class night gains and also closes the gate-utility disagreement in the diagnostic, our mechanism is redundant, and we will report it as such.
Why not just switch modalities by global illumination, as MBNet and UA-CMDet's illumination-aware suppression do? An image-level illumination switch cannot express the case our hypothesis targets. In a single dark frame, thermal is best for cars, while RGB, even when weak, carries the texture that separates vans and freight cars, especially under streetlights. We will test this with a variant whose gate is a function of estimated illumination only. If that variant matches the full method on rare classes, per-object gating adds nothing.
Why not just use thermal alone at night? UA-CMDet's own numbers show thermal-only trailing fusion overall on DroneVehicle (59.15% versus 64.01% mAP). The file attributes thermal's weakness partly to missing surface texture and to thermal crossover. Overall mAP is dominated by cars, however, so the relevant test is per-class. We will report thermal-only rare-class AP at night. If it equals fusion there, the color camera contributes nothing to rare classes at night, and our premise fails.
Proposed Experiments
Training and evaluation use DroneVehicle, whose 28,439 RGB-thermal pairs, five classes, and pronounced long tail make it the primary testbed. VEDAI tests transfer to eleven small-vehicle classes. LLVIP is a deliberate control: it has a single pedestrian class, so class balancing is inactive and only the per-object area normalization remains, and we predict at most a small gain there.
Metrics are mAP50-95 and mAP50 overall, per-class AP, and mean AP over the classes in the lower half of the training-frequency distribution. Each is stratified into illumination bins by mean RGB intensity, and into object-area bins so that small and very small targets are reported separately. We also report gate-utility agreement per class and per illumination bin, before and after training with our gate loss.
The decisive checks are three predictions that the hypothesis makes and its alternatives do not. First, the rare-class gain is concentrated in low- and mid-illumination bins rather than spread uniformly. Second, the same weights applied to the detection loss give a smaller rare-class gain and leave gate disagreement largely unchanged. Third, the LLVIP control shows little or no improvement. A uniform gain, a match from task-loss rebalancing, or a large LLVIP gain would each point to a generic regularization effect rather than the mechanism we propose.
References
- EGM-Det: Entropy-Guided Multimodal Adaptive Fusion for UAV RGB-IR Object Detection
- Drone Based RGBT Vehicle Detection and Counting: A Challenge
- Improving Multispectral Pedestrian Detection by Addressing Modality Imbalance Problems
- SuperYOLO: Super Resolution Assisted Object Detection in Multimodal Remote Sensing Imagery
- Automatic Brain Tumor Detection and Segmentation Using U-Net Based Fully Convolutional Networks
- Gradient-Aware for Class-Imbalanced Semi-supervised Medical Image Segmentation
- Attention gated networks: Learning to leverage salient regions in medical images
- Boosting Object Detection with Zero-Shot Day-Night Domain Adaptation
- NightAdapter: Learning a Frequency Adapter for Generalizable Night-time Scene Segmentation