A network that predicts several things about one image at once, such as which object each pixel belongs to, how far away it is, and which way its surface faces, often gives answers that contradict each other. It can label a pixel "floor" while predicting a surface normal (the direction the surface faces) that points sideways. It can draw an object boundary where depth and orientation are perfectly smooth. These contradictions are easy to write down as logical rules. The usual way to use such rules is to turn them into an extra loss on the network's final outputs. Once that loss is backpropagated, every layer receives it, including the high-resolution early layers that encode edges and fine geometry. This proposal tests a narrower and more specific idea. Each rule describes relations at a particular spatial scale, so its training signal should reach the shared network only at the matching level of the feature pyramid (the stack of feature maps from fine, early layers to coarse, deep ones). Pixel-pair boundary rules would enter at fine levels. Region-level semantic rules, such as "floor regions face up" or "supported objects lie above their support", would enter at coarse levels.
The claim is that routing constraint gradients by scale lets symbolic knowledge improve every task, especially when labels are scarce, without the constraint loss and the dense task losses competing destructively inside shared early layers. Two things would be new: the routing itself, and the measurement of how symbolic losses interfere with perceptual losses at each depth. In two sentences for a colleague: logical consistency rules between segmentation, depth and normals should be trained into the network only at the pyramid level whose spatial scale matches the rule. We test whether this beats applying the same rules at the output, and whether it beats generic gradient-conflict fixes.
What exists and what is missing
The closest neuro-symbolic work supplies the method for turning rules into losses. Scalable Regularization of Scene Graph Generation Models using Symbolic Theories compiles large rule bases into negative integrity constraints (statements of what must never co-occur). At each step it penalizes the top-k most violated ones as a differentiable loss, and it reports gains of "up to 33%" along with robustness when 75% of labels are removed. We reuse that recipe: fuzzy-logic relaxation plus selection of the most violated rules. NGP applies it only at the final relationship head of a fixed detector, and it never asks where in the backbone the penalty should act. Out-of-Distribution Generalization by Neural-Symbolic Joint Training shows that logic can usefully regularize perception through a semantic loss (68.6% vs 35.1% for LSTMs on 20-digit addition). It works on flat, single-scale digit patches with a single task.
Neuro-Symbolic Hierarchical Rule Induction is also hierarchical, but only in logic. It stacks invented predicates in layers over pre-extracted relations and never touches a feature pyramid. Its hierarchy therefore motivates, and does not anticipate, the idea of matching rule levels to perceptual levels. Pipeline systems such as Neural-Symbolic VQA and Multimodal Graph Networks reason over pooled per-object vectors. NS-VQA's Minecraft failures came from missed occluded segments, which is evidence that fine-scale perception is where these systems break. Both constrain our design, because both show that discarding intermediate scales is costly.
On the multi-task side, RotoGrad treats negative transfer as two problems: mismatched gradient sizes and opposing gradient directions. It fixes both by rescaling and rotating a single shared representation, evaluated on NYUv2 segmentation, depth and normals. RotoGrad is the strongest generic competitor. Its single-vector view is exactly what we depart from, because we locate conflict per pyramid level and resolve it structurally rather than by optimization. On the fusion side, Pixel-wise Deep Learning for Contour Detection shows that different depths carry different information. Conv2 alone gives ODS .699 on BSDS500, and concatenating Conv1–Conv5 gives .741. That result supports the premise that boundary-type predicates live in shallow features.
Core mechanism
We start from a standard multi-task dense model: a backbone, a feature pyramid with fused levels $F_1,\dots,F_L$ (from fine to coarse), and three heads for segmentation, depth and normals. Predicates are read off the head outputs. Examples are $\text{floor}(p)$ from segmentation probabilities, $\text{up}(p)$ from the normal's vertical component, and $\text{jump}(p,q)$ from depth or normal differences between neighboring pixels. The rule set is small and hand-written, about a dozen rules. It covers class-conditioned orientation (floor→up, ceiling→down, wall→horizontal), boundary explanation (a label change between $p$ and $q$ implies a depth jump or a normal jump), planarity within a region, and vertical support between region pairs. Each rule $r$ is relaxed with the product t-norm into a violation $v_r \in [0,1]$ and assigned a level $\ell(r)$ by its spatial extent. Pixel-pair rules go to stride 4, and region and region-pair rules go to stride 16 or 32.
The routed constraint loss is
$$\mathcal{L}_{\text{sym}} = \sum_{r \in \text{top-}k} v_r\big(h(\hat F^{(r)})\big), \qquad \hat F^{(r)}_j = \begin{cases} F_j & j = \ell(r) \\ \mathrm{sg}(F_j) & j \neq \ell(r) \end{cases}$$
Here $h$ denotes the task heads applied to the fused pyramid, $\mathrm{sg}$ is stop-gradient, and the top-k selection follows NGP. The rule's gradient updates the heads, and it enters the shared network only through its assigned level. The task losses backpropagate normally. In practice we run one extra decoder pass per rule group, which amounts to two groups, fine and coarse. A learned variant replaces the fixed $\ell(r)$ with a softmax gate over levels per rule. This lets us check whether learned routing recovers the hand assignment.
Research Program
The program has three parts. The first is diagnostic, and it is useful even if the method fails. Using an unrouted constraint loss, we measure the cosine similarity between the constraint gradient and each task's gradient at every pyramid level and backbone stage over training. The prediction is that coarse, region-level rules conflict with depth and normal gradients mainly in shallow layers, and that boundary rules conflict mainly in deep layers. If conflict is uniform across depth, the premise is wrong and we report that.
The second part builds the routed model and compares it with output-level constraints and with gradient-surgery methods. We test in two regimes: full NYUv2 labels, and a label-scarce regime with 25% of segmentation labels kept and depth and normals sparsified. The label-scarce regime is where NGP's evidence suggests rules matter most.
The third part is a negative control. We use CelebA attribute prediction with image-level logical rules (for example, a bald person cannot have wavy hair). All rules there are global, so routing should give no benefit over output-level constraints. A benefit on CelebA would suggest the gain comes from something other than scale matching.
Baselines
The naive reference point is the same backbone and pyramid trained on the plain sum of the three task losses, with no rules. It is compared against single-task models of the same architecture, so that we can report the standard average relative change across tasks.
The strongest existing method is RotoGrad (RotoGrad), applied both without rules and with our rule loss treated as a fourth task. That makes it the most direct competitor for any benefit that routing would claim. We have to be exact about its numbers: RotoGrad reports the best segmentation and depth results among its compared methods on NYUv2, but no reported result found on Lacuna for RotoGrad's NYUv2 mIoU, depth error or normal angle error. We will therefore rerun it ourselves with the same backbone, epochs, augmentation and hyperparameter search budget as every other arm.
The neuro-symbolic baseline is NGP-style output constraints (Scalable Regularization of Scene Graph Generation Models using Symbolic Theories). It uses the identical rule set, relaxation and top-k selection, but the gradient flows through all levels. Isolating routing requires three more ablations with everything else held fixed. The first is swapped routing, which sends fine rules to coarse levels and coarse rules to fine levels. The second sends all rules to all levels but scales gradients to match the routed arm's total magnitude, which separates "where" from "how much". The third is learned gating.
All arms get the same compute. Routed arms pay for the extra decoder pass, so non-routed arms receive matching additional steps.
Beating the baselines means the following. Routed constraints must improve the average relative multi-task metric over both output-level constraints and rules-plus-RotoGrad, across three seeds with non-overlapping confidence intervals. They must also not trail on any single task by more than seed noise. Finally, swapped routing must fall clearly below correct routing.
Why not just…?
Why not just add the rule loss and let RotoGrad or another gradient-conflict method sort it out? This is the real threat. RotoGrad already improves segmentation, depth and normals over plain optimization on NYUv2 without knowing anything about scale. Our argument is that RotoGrad rotates one shared representation, whereas the conflict we expect is concentrated at specific depths. A global correction must trade off across all depths at once. The rules-plus-RotoGrad arm decides this directly. If it matches routed constraints, the contribution shrinks to the per-level diagnostic, and we will say so.
Why not just repair outputs at test time? Projecting predictions onto the rule-consistent set after inference would cut violation rates at almost no cost. It cannot, however, improve the features that other predictions depend on. We include a test-time projection arm on the naive model. Our claim is limited to gains in the task metrics (mIoU, depth error, normal error), not only in consistency, and those gains must hold on pixels where no rule fires.
Why not just use a larger multi-scale backbone with no rules? CLEVR and GQA show that purely neural models remain inconsistent: GQA reports top models failing consistency about 20% of the time. That evidence comes from question answering, not dense prediction, so it only motivates the concern. We add a capacity-matched arm that gets the parameters and FLOPs of the extra decoder pass as a wider pyramid. The comparison is sharpest in the label-scarce regime, where rules add information that capacity cannot.
Why not just use a continuous depth–normal consistency loss instead of logic? Geometric consistency between depth and normals is one of our rules and is included in every constrained arm. The discrete, class-conditioned rules (floor→up, boundary→jump) are what continuous geometry cannot express. A geometry-only arm measures how much the symbolic, semantics-linked rules add on top.
Proposed Experiments and Decisive Checks
Everything runs on NYUv2 with its standard three dense tasks. We report mIoU and pixel accuracy for segmentation, absolute relative error and RMSE for depth, and mean angular error and the fraction of pixels within 11.25° for normals. Alongside these we report the average relative multi-task change and a held-out rule-violation rate. The label-scarce variant repeats every arm. CelebA serves as the global-rule control.
Four outcomes decide the idea. First, correct routing must beat swapped routing; if it does not, scale matching is not the mechanism. Second, routed constraints must beat both output-level constraints and rules-plus-RotoGrad under equal compute; if they do not, the method adds nothing over existing tools. Third, the per-level gradient-conflict profile must show depth-specific conflict that routing removes; if it does not, the explanation is wrong even if the numbers move. Fourth, CelebA must show no routing benefit; a benefit there would point to a confound. If learned gates converge to the hand-assigned levels, that independently confirms that predicates have a natural home in the pyramid. This is the scale-stratified grounding that current neuro-symbolic systems, which read only pooled top-level features, have never tested.
References
- Scalable Theory-Driven Regularization of Scene Graph Generation Models
- Out-of-Distribution Generalization by Neural-Symbolic Joint Training
- Neuro-Symbolic Hierarchical Rule Induction
- Neural-Symbolic VQA: Disentangling Reasoning from Vision and Language Understanding
- Multimodal Graph Networks for Compositional Generalization in Visual Question Answering
- RotoGrad: Gradient Homogenization in Multi-Task Learning
- Pixel-wise Deep Learning for Contour Detection
- CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning
- GQA: A New Dataset for Real-World Visual Reasoning and Compositional Question Answering