Where Does Risk Move When Conditions Change? State-Conditioned Skip Gating for Dynamic Crash Risk Maps

City crash-risk maps are usually treated as either fixed or uniformly scaled. A static map says intersection A is more dangerous than street B. A time-of-day or weather factor then raises or lowers the whole city together. Dynamic risk assessment, in its own terms, asks for something stronger: the probability of failure given the current state, place by place. This note proposes to test, and to model, the part of crash risk that a "static map times a city-wide clock" cannot represent: the way rain, an incident, or a surge in traffic flow redistributes risk across space.

The model is a U-Net, an image-to-image network that compresses a map into coarse features and then expands it back, with "skip connections" that pass fine-scale detail directly from the compressing half to the expanding half. In our version, the signal sent along each skip connection is filtered by channel and spatial attention, meaning learned weights that decide which feature types and which map locations to pass through. Unlike standard attention, these weights are computed from a summary of the live operating state rather than from the feature map alone. The claim is falsifiable. If dynamic risk is mostly separable into a fixed map and a city-wide factor, a much simpler model will match ours, and the experiments are designed to show that outcome if it is true.

Core Claim

We write the expected crash count in grid cell $x$ during hour $t$ as $\lambda(x,t)$ and decompose its logarithm as

$$\log \lambda(x,t) = s(x) + g(t) + h(x,t),$$

where $s(x)$ is a static structural risk map built from road layout and points of interest, $g(t)$ is a city-wide temporal factor driven by hour, day, and weather, and $h(x,t)$ is the non-separable remainder, the place-specific response to current conditions.

Existing dense risk maps estimate $s$ well but ignore $t$. He et al. built a 5 m encoder-decoder risk map from satellite imagery, GPS trajectories, and crash history, beating kernel density estimation by 4.87 AP points. That map is static by construction. Hourly forecasters such as GSNet and ST-TAR model $t$, but they never ask how much of their gain comes from $h$ rather than from $g$.

Our claim has two parts. First, $h$ carries a measurable share of held-out risk variation under non-routine conditions, namely precipitation hours, hours with active incident reports, and abnormal flow surges. Second, gating skip connections on the operating state is what lets a convolutional encoder-decoder recover $h$ without being swamped by the many zero-crash cells. If the first part is false, the second does not matter, and we will report that result.

Why this framing, given the prior work

Two findings in the literature motivate the framing because they conflict. In the Traffic4cast NeurIPS 2020 competition, top U-Net entries got little or no value from ancillary channels, including incident reports, when those channels were simply stacked as extra image inputs. In contrast, GSNet and the R-PLS model of Dai et al. find that semantic context, such as points of interest or proximity to school zones, drives local risk spikes. Dai et al. score risk as likelihood × severity × spatiotemporal sensitivity, with the third term capturing local context.

One reconciliation is that context matters only conditionally and locally. Rain matters on highway ramps, not everywhere. A uniformly concatenated channel then averages out, but a state-conditioned gate could pick it up. This is a hypothesis about $h$, which is why we measure $h$ directly.

Other work shapes the method. CBAM supplies the attention design: channel attention computed from both average and max pooling, followed by spatial attention. Woo et al. show this channel-then-spatial order beats parallel or reversed orderings, and that adding spatial attention beats channel-only squeeze-and-excitation on ImageNet (22.66% versus 23.14% top-1 error with ResNet-50). Max pooling matters here because hazard precursors are local peaks. Xu et al. supply the spatiotemporal U-Net recipe: stacked recent frames, a road mask, and two-stage fine-tuning. They also warn that a plain mean-squared-error loss produces blurry outputs that miss sharp local onsets. That warning is why we use a count likelihood rather than mean squared error.

Two findings constrain the design. Zero-inflation, meaning grids where more than 98% of cells record no crash, pushes naive models toward predicting zero everywhere (ST-TAR, Jiang et al.), and attention maps can collapse under such sparse labels. We therefore include an unconditioned CBAM-on-skips variant specifically to see whether attention without state conditioning collapses.

Finally, ReSonAte shows dynamic risk beating static estimates by a likelihood ratio of 30.9 in CARLA, but only for a single lumped system. Chockalingam et al. argue that the unsolved step is evaluation: deciding where to act. That argument motivates our budgeted-allocation metric.

Research Program

The model has three parts, one for each term of the decomposition.

The static branch takes only time-invariant rasters, such as road structure and point-of-interest density, and produces $s(x)$. It is trained jointly but cannot see the clock or the weather.

The dynamic U-Net takes the past several hours of gridded mobility and crash counts, stacked as channels following Xu et al.. It also takes rasterized context, including incident reports where available.

A small state encoder maps the operating state to a vector $z_t$. The state consists of the weather vector, calendar features, and globally pooled current dynamics. The vector $z_t$ is fed into every skip gate. The channel gate is CBAM's shared pooling network with $z_t$ added to its input. The spatial gate convolves the pooled feature slices together with a projection of $z_t$ broadcast over the grid. The gated decoder output is split into a spatially pooled component, which estimates $g(t)$, and a mean-zero spatial residual, which estimates $h(x,t)$.

Training uses a hurdle Poisson likelihood, which models the chance of zero crashes and the count when crashes occur as separate pieces. We compare it against GSNet's weighted loss so that the effect of the loss and the effect of the gate can be told apart.

The analysis is as important as the model. On held-out hours we fit the decomposition, then report the fraction of explained log-rate variance attributable to $h$, overall and within the non-routine strata. We also inspect where the spatial gates fire under rain versus dry conditions. We restrict claims to $h$ estimates that are stable across random seeds, so that attention maps are not read as explanations when they are noise.

Baselines

The do-nothing reference is the historical per-cell, per-hour-of-week crash rate. Its smoothed variant is kernel density estimation, which He et al. beat by 4.87 AP and 8.8% lower RMSE in the static setting. Both run on identical grids and splits, and any learned model must beat them on the high-risk-cell metrics, not only on RMSE.

The strongest published method with a number in our file is GSNet. It combines a convolutional and recurrent geographic branch with temporal attention and a graph-convolutional semantic branch, and reports RMSE 7.5158 and rush-hour Recall 35.30% on NYC. ST-TAR is reported to beat GSNet on RMSE and MAP, but no reported result for ST-TAR's numeric values was found on Lacuna. We will rerun both from their released configurations on our splits rather than quote numbers. Beating them means lower RMSE and higher Recall/MAP than both under the same split, with a stronger margin on the non-routine strata.

The separable model is the key competitor for the scientific claim. It is our own architecture with $h$ forced to zero, so it outputs a learned static map plus a learned city-wide temporal factor. It is fit with the same loss, data, and tuning budget. If it matches the full model on held-out non-routine hours, the central claim fails.

Two further ablations isolate the gate. The first is a plain U-Net that receives the same context channels by concatenation, as in Traffic4cast. The second is a U-Net with unconditioned CBAM on its skips. Comparing them with the full model separates "attention helps" from "state conditioning helps."

Every model receives the same input features, the same 30-trial hyperparameter search, the same early-stopping rule, and both loss options. Results are averaged over five seeds and reported with confidence intervals.

Why not just…?

Why not just concatenate context channels and fix the loss? This is a real threat. GSNet's weighted loss and ST-TAR's soft targets suggest that much of the zero-inflation problem is in the objective, not the architecture. Our concatenation ablation is trained with the hurdle and weighted losses too. If it matches the gated model, we conclude that the gate is unnecessary and report that the Traffic4cast "ancillary data is useless" result came from the loss rather than the architecture.

Why not just multiply a static risk map by a time-and-weather factor? This is the separable baseline above, and it is the most likely way the proposal fails. Dynamic risk surveys stress time variation, but nothing in the file shows that the variation is spatially non-uniform. The variance share of $h$ on held-out hours settles the question. A share indistinguishable from zero across seeds means the simpler model is correct.

Why not just use a graph network like ST-TAR? ST-TAR is faster than hybrid convolution-plus-graph models and handles zero-inflation well. However, graph networks predict only at predefined nodes, while the static branch here inherits He et al.'s dense, off-network mapping. We compare against ST-TAR directly on its own NYC and Chicago data. If it wins on node-level metrics, the grid model's remaining value lies only in dense output, and we will say so.

Why not just gradient-boosted trees per cell? The file reports no boosting baseline. The closest evidence is Chen et al., where a denoising autoencoder reached RMSE 1.00 against 1.41 for a decision tree on Tokyo, which is suggestive but not conclusive. We include LightGBM with lagged neighbourhood features and interactions with the state variables as a tuned baseline. Trees can represent $h$ through those interactions, so they test whether convolution is needed at all.

Proposed Experiments

The primary testbed is the NYC (147,000 crashes, 2013) and Chicago (44,000 crashes, 2016) hourly datasets used by GSNet and ST-TAR, with their taxi-flow, weather, and point-of-interest features. We report RMSE, Recall* and MAP on high-risk cells, and a budgeted-allocation score: the fraction of next-hour crashes falling in the top-$k$ predicted cells for several patrol budgets $k$. We also report reliability of the predicted counts, since calibration is the open problem flagged for dynamic risk. Every metric is broken out by routine and non-routine strata.

The decisive check is the held-out variance share of $h$. We additionally run a "condition transfer" split that trains with some heavy-rain days withheld and tests on them, to see whether the gate generalizes rather than memorizes.

A secondary test revisits the ancillary-data paradox on Traffic4cast 2020, where Xu et al. report a validation MSE of 0.00116868. We compare plain and state-gated U-Nets with and without the incident channel, scoring cells near reported incidents separately. A gain that appears only near incidents and only with gating would support the reconciliation proposed above.

As an optional dense-field extension, we will grid US-Accidents, whose records carry weather and twilight attributes, to test whether $h$ appears at countrywide scale. No reported result was found on Lacuna for a gridded forecasting baseline on US-Accidents, so we will report only our own baselines there.