Using Spaxiom for Street-Level Safety Monitoring with Radar, Acoustic & IMU Data
Joe Scanlin
November 2025
Spaxiom is a sensor abstraction layer and runtime that translates billions of heterogeneous sensor streams into structured, semantic events. It provides a spatial-temporal DSL for defining zones, entities, and conditions, making it easy to build context-aware applications across industries.
INTENT (Intelligent Network for Temporal & Embodied Neuro-symbolic Tasks) is Spaxiom's high-level event vocabulary. Instead of overwhelming AI agents with raw sensor data, Spaxiom emits compact, meaningful events that agents can immediately understand and act upon.
Cities struggle to manage safety for bikes, e-scooters, and pedestrians as micro-mobility grows. Today's approach relies on crash reports that come too late, manual video studies, and scattered anecdotal feedback. The most valuable data—near misses, sudden braking, and risky patterns—never gets recorded in a usable format. The challenge is that roadside radar operates independently from scooter fleet telemetry, traffic signal systems, and acoustic sensors, creating data silos that AI agents can't connect to identify dangerous patterns.
Spaxiom acts as a "street-level safety cortex" that fuses radar tracking, acoustic sensors, scooter/bike IMU data, and traffic signals into one intelligent system. Instead of city planners sifting through crash statistics months later, Spaxiom detects near-miss patterns in real time and sends alerts like "unsafe crossing detected at Main & 5th" or "speeding corridor on Oak Avenue." This helps cities identify dangerous intersections before someone gets hurt, adjust traffic signals, add bike lanes where needed, and target enforcement to the riskiest locations.
As cities densify and micro-mobility (bikes, e-scooters, small EVs) proliferates, safety and flow management become critical. Today, safety analysis often relies on:
However, the most informative signals are often the near misses and repeated risky patterns: sudden braking, evasive maneuvers, conflicts between modes, and unsafe speeds at known bottlenecks. These rarely make it into structured datasets.
Spaxiom can act as a street-level safety cortex, fusing radar, acoustic, and IMU signals from vehicles and infrastructure into INTENT events like NearMissCluster, SpeedingCorridor, and UnsafeCrossing.
At the city scale, relevant sensors include:
Spaxiom ingests processed features from these sources (not raw full-resolution waveforms or video) and maps them into a common spatial model of the street network (segments, intersections, crosswalks, lanes).
We define several safety-relevant INTENT events:
NearMiss: a spatiotemporal configuration where two or more agents come within a critical distance at relative speed above a threshold without collision;HarshEvent: harsh braking, swerving, or strong lateral acceleration from IMU traces;SpeedingCorridor: persistent high share of vehicles exceeding speed limits on a segment;UnsafeCrossing: repeated near misses or HarshEvents at or near a crosswalk or intersection.Near-miss detection. Consider two agents a and b (e.g., a car and a cyclist) with positions xa(t), xb(t) and velocities va(t), vb(t). For a short horizon τ ∈ [0, τmax], approximate future positions with constant velocity:
Define the predicted minimum separation distance over that horizon:
Let Δv(t) = va(t) - vb(t), and define relative speed vrel(t) = ‖Δv(t)‖.
A near-miss candidate is a triple (a,b,t) such that:
where dnmthresh (e.g., 1–2 m) and vnmthresh (e.g., 5 m/s) are thresholds.
Each such event can be encapsulated as a NearMiss INTENT event with attributes:
Segment-level risk score. For a road segment ℓ over a period [t0, t1], define:
A simple risk index for segment ℓ is:
with weights α, β > 0. Segments with high Rℓ are candidates for SpeedingCorridor or UnsafeCrossing labels, depending on their geometry.
We can represent a segment or intersection in the DSL as an object that aggregates INTENT events and IMU-derived HarshEvents.
from spaxiom import Condition
from spaxiom.temporal import within
from spaxiom.logic import on
class RoadSegment:
def __init__(self, seg_id, near_miss_stream, harsh_stream, volume_stream):
self.seg_id = seg_id
self.near_miss_stream = near_miss_stream # yields NearMiss events
self.harsh_stream = harsh_stream # yields HarshEvent events
self.volume_stream = volume_stream # yields vehicle passage counts
def counts(self, window_s: float):
nm_events = self.near_miss_stream.history(window_s=window_s)
harsh_events = self.harsh_stream.history(window_s=window_s)
volume_events = self.volume_stream.history(window_s=window_s)
N_nm = len(nm_events)
N_harsh = len(harsh_events)
N_veh = sum(e["count"] for _, e in volume_events) or 1
return N_nm, N_harsh, N_veh
def risk_index(self, window_s: float) -> float:
N_nm, N_harsh, N_veh = self.counts(window_s)
alpha, beta = 1.0, 0.5
return alpha * (N_nm / N_veh) + beta * (N_harsh / N_veh)
# Example network segments
seg_main_1 = RoadSegment(
seg_id="main_st_block_1",
near_miss_stream=nm_main_1,
harsh_stream=harsh_main_1,
volume_stream=volume_main_1,
)
seg_main_2 = RoadSegment(
seg_id="main_st_block_2",
near_miss_stream=nm_main_2,
harsh_stream=harsh_main_2,
volume_stream=volume_main_2,
)
segments = [seg_main_1, seg_main_2]
# Condition to periodically assess risk
tick_15m = within(900, Condition(lambda: True))
@on(tick_15m)
def micromobility_safety_agent():
window_s = 7 * 24 * 3600 # last 7 days
for seg in segments:
R = seg.risk_index(window_s)
if R > 0.01: # example threshold
emit_intent_event({
"type": "UnsafeCrossing" if is_crossing(seg.seg_id) else "SpeedingCorridor",
"segment": seg.seg_id,
"risk_index": R,
"window_s": window_s,
})
# The resulting stream of UnsafeCrossing / SpeedingCorridor events can drive:
# - infrastructure recommendations,
# - signal timing changes,
# - or targeted enforcement and education campaigns.
In a fuller implementation, separate Spaxiom patterns would compute NearMiss and HarshEvent INTENT events directly from radar and IMU streams, providing reusable building blocks across cities.
Figure A.4: Street network safety heatmap for a downtown district over a 7-day period. Each road segment is colored by its risk index Rℓ (green = low risk, yellow/orange = medium, red = high). The intersection at Main St & 5th St shows high near-miss frequency (marked with ⚠️ icon) and is annotated with example near-miss trajectories between vehicles and vulnerable road users. The inset bar chart shows the distribution of Rℓ across all 24 segments, with the worst decile (2 critical segments including Main & 5th) highlighted in red with dashed border.