Counting Moving Objects with Scene-Wide Affinities

Event cameras are sensors that report per-pixel brightness changes as an asynchronous stream rather than as frames. Segmenting their output by motion means grouping events so that each group shares one physical motion, and the number of groups is not known ahead of time. The leading methods decide how many moving objects exist in one of two ways. Some charge a fixed penalty for every motion label they create. Others peel away one dominant motion at a time. In both cases the evidence for an object is gathered over a local neighbourhood graph. The penalty-based methods also report a recurring failure: small objects, under about 1% of the sensor, are merged into the background and never counted. We argue this is not only a tuning problem. Whether a patch of events moves "independently" is a relative judgment. It is made against the motion of the whole scene, meaning the camera's own motion as expressed everywhere else. A purely local graph cannot see the rest of the scene.

We propose to predict, for pairs of event regions, the probability that they belong to the same motion. The prediction comes from a network whose receptive field covers the entire scene at close to linear cost, built from criss-cross attention and global feature broadcasting. We then let the number of objects fall out of a minimum-cost multicut. A multicut is a graph partition in which negative ("repulsive") edge weights make cutting profitable, so no cluster count and no per-label penalty is needed. The question we test is narrow and falsifiable. Does giving the pairwise judgment a scene-wide view fix cardinality errors on small and fragmented objects, beyond what a local network, a tuned label penalty, or explicit ego-motion compensation already achieve?

Core Claim

Small-object erasure in the event-based graph-cut method of Event-Based Motion Segmentation With Spatio-Temporal Graph Cuts comes from two parsimony forces that are both tuned for large objects. The first is the constant label cost $\beta$. A small object's total gain in data fit scales with its event count, so it can fall below $\beta$. The second is the Potts smoothness term on a Delaunay graph. A small object has many boundary edges relative to its interior, and most of its neighbours are background events. The same paper notes that noise corrupts these local Delaunay edges.

We claim that both forces can be replaced by learned pairwise affinities. Each affinity must be computed with access to a scene-level motion summary, because "different from the background" means different from the global ego-motion field at that location. Once the affinities are good, a multicut partition as in Motion Trajectory Segmentation via Minimum Cost Multicuts yields the cardinality directly.

Concretely, let $\rho_{pq}\in(0,1)$ be the predicted probability that nodes $p$ and $q$ move together. We solve

$$\min_{y\in\{0,1\}^{E}} \sum_{(p,q)\in E} y_{pq}\,\log\frac{\rho_{pq}}{1-\rho_{pq}}$$

subject to $y$ being a valid multicut, meaning cut edges $y_{pq}=1$ form consistent cycles. Here $E$ is the edge set. Edges with $\rho_{pq}<0.5$ have negative cost, so cutting them lowers the energy. The number of objects is the number of connected components that remain.

What is new is the pairing. The affinities come from a global-context operator, and the graph $E$ includes sparse long-range edges along the same row, column and time slice that the attention operator itself routes along. Two fragments of one occluded object can therefore be joined directly, and two distant objects with identical velocity can be separated directly. Prior multicut work used handcrafted local affinities plus temporal bridging edges. Prior global-context work never produced a partition of unknown size.

Research Program

The input is a spatio-temporal voxel grid of events. Nodes are small event voxels over-segmented to a few thousand per time window. This keeps the multicut tractable with the Kernighan-Lin heuristic used by the multicut paper, or with greedy edge contraction.

The affinity network has three parts. The first is a convolutional encoder. The second is two rounds of recurrent criss-cross attention, taken from CCNet: Criss-Cross Attention for Semantic Segmentation, which lets every location gather information from every other location at $O(N\sqrt{N})$ cost; CCNet reports 11x less memory than a full non-local block. The third is a broadcast step from Broadcasting Convolutional Network for Visual Relational Reasoning. That step appends coordinate channels, max-pools a global state, and copies it back to every location so that each location is compared against the scene summary at $O(n)$ cost. The pairwise head takes both node embeddings plus their coordinate offset and outputs $\rho_{pq}$.

We use criss-cross attention and broadcasting for their efficiency and their explicit spatial coordinates. We do not use full non-local attention, which does not fit dense spatio-temporal grids. The channel-mixing generalization in Compact Generalized Non-local Network is kept as an alternative operator if criss-cross attention underperforms.

Training uses a pairwise cross-entropy on same-object versus different-object labels, drawn from ground-truth masks on the training splits of the event benchmarks and supplemented by simulated events from rendered scenes. Edge sampling is biased toward pairs that involve small objects and object boundaries. The loss never sees a cluster count. Cardinality is a test-time emergent quantity, and that is exactly what we evaluate.

The analysis contribution is a stratified error study. We measure cardinality error and per-object recall as functions of object size, event noise rate, and velocity similarity to other objects. The aim is to find which of the two parsimony forces causes erasure in the graph-cut baseline, and whether the learned global affinities remove it.

Baselines

The naive reference point is a single-cluster assignment, which labels everything as background, together with an oracle-$k$ spectral clustering of our own learned affinities. The second of these bounds how much of any gain comes from the affinities alone rather than from discovering the count. Motion Trajectory Segmentation via Minimum Cost Multicuts already shows spectral clustering's balancing bias on FBMS-59, recovering 17 objects versus 31 for multicuts. We expect the oracle-$k$ variant to lose on small objects, and we will check this.

The first strong published competitor is the spatio-temporal graph cut with label cost of Event-Based Motion Segmentation With Spatio-Temporal Graph Cuts. It is the method that exhibits the failure we target. It reports 76.81% IoU on EVIMO and a 97.45% detection rate on the Extreme Event Dataset. We run its released configuration, and also a version where $\beta$ is tuned per dataset on the same validation split we use for our own threshold. This gives it an equal tuning budget.

The strongest competitor overall is Iterative Event-based Motion Segmentation by Variational Contrast Maximization. It peels off ego-motion and then residual motions without a preset count, and reports an IoU of 0.84 on EVIMO2 against a previous best of 0.64, at about 10 seconds for 3 clusters. Beating it means matching or exceeding 0.84 IoU on EVIMO2 overall, while clearly improving recall and count accuracy on objects under 1% of the sensor, and at lower latency than 10 seconds.

Two ablations isolate the key ingredient. The local-only ablation replaces the criss-cross and broadcast blocks with extra convolutional layers of matched parameter count and FLOPs, and drops the long-range edges. The explicit-ego-motion ablation feeds the local-only network with events warped by a globally estimated ego-motion. This hands the local model the scene-level information by hand.

Why not just…?

Why not just lower $\beta$, or scale it with cluster size? A smaller or size-normalized penalty does rescue small objects. It also rescues small noise blobs and fragments of large objects, because a constant or size-scaled cost cannot tell a small real mover from a small artifact; both are small. The Potts perimeter penalty would still suppress small objects. Our per-dataset $\beta$ sweep traces the full precision–recall curve of object counts for the graph-cut method. The proposal only succeeds if our operating point lies above that curve, not merely at a different point on it.

Why not just compensate ego-motion first and cluster the residual locally? This is the most serious threat, and it is essentially what iterative contrast maximization does. If the only role of global context is to supply the ego-motion field, the explicit-ego-motion ablation should match the full model. We expect it to fall short in two places. The first is under translation with depth parallax, where static near structure leaves a residual; 3D Rigid Motion Segmentation with Mixed and Unknown Number of Models documents this regime and the failure of single-model fits there. The second is under heavy noise, where the residual map is itself unreliable. If the ablation ties the full model, we will report that the contribution is the learned multicut, not the receptive field.

Why not just split same-velocity clusters by spatial connected components? For spatially separated objects with identical motion, the aliasing case flagged by the contrast-maximization paper, connected components probably works, and we include it as post-processing on every baseline. Connected components cannot also rejoin a single object fragmented by occlusion or sparse events, because it only splits. Our long-range edges can do both. The fragmented-object stratum tests whether that matters in practice.

Why not just a full non-local block, or a deeper CNN? Full attention over spatio-temporal voxels is quadratic in the number of locations. CCNet measures an 11x memory cost against factorized attention even on single images. Deeper stacks with downsampling erode fine boundaries, as noted by Guanbin Li et al., and small objects are exactly those fine boundaries. The matched-FLOPs local ablation tests the depth route directly.

Proposed Experiments

The primary benchmarks are EVIMO and EVIMO2 for mask IoU. The Extreme Event Dataset is used for detection rate under high speed. EMSGC and the Event Camera Dataset are used for qualitative and count evaluation, and we found no reported result on Lacuna for either. On every benchmark we report IoU, detection rate, the fraction of windows with the correct object count, and per-object recall binned by object area, with a dedicated bin below 1% of the sensor. We also report wall-clock latency on identical hardware.

For a secondary check on frame video, we run the same affinity-plus-multicut pipeline on trajectory grids from FBMS-59, where multicuts recovered 31 objects with F-measure above 75%. We also run it on Hopkins 155, where the mixed-model method of Xu et al. reports 91.61% correct cluster-number estimation and 0.31% mean error. These tests ask whether the gain transfers beyond event data.

Three checks decide the claim. The first compares the full model with the local-only ablation on count accuracy in the small-object bin. A gap within seed variance would falsify the receptive-field hypothesis. The second compares the full model with the explicit-ego-motion ablation under forward translation and injected noise. This separates "global context equals ego-motion" from "global context does more." The third is a noise sweep, in which we add uniform background events and measure how quickly count accuracy degrades for our method versus the Delaunay graph cut. This tests whether learned long-range edges are more robust than local triangulation to the edge corruption the graph-cut authors describe.