TL;DR
LastAct introduces a trajectory-centric framework for real-time smart-home activity recognition that tackles "boundary contamination"—the messy transitions captured by sliding windows. By projecting sparse sensor events onto a 2D floorplan and utilizing a modular gating and boundary-localization mechanism, it isolates the most recent activity from stale historical context. This approach yields massive robustness gains in realistic, unsegmented sensor streams without sacrificing performance on clean data.
What Problem Does This Paper Address?
Real-world smart-home Human Activity Recognition (HAR) relies on ambient sensors (like motion detectors, door contacts, and smart switches) that stream data continuously. To perform real-time inference, deployment systems typically use sliding windows. However, human activities do not neatly align with fixed window boundaries. This creates boundary contamination: windows that straddle transitions and contain fragments of multiple activities.
Standard models are trained on perfectly pre-segmented data and usually predict based on majority context. Consequently, they fail when a new activity has just begun and only occupies a small fraction of the window. Furthermore, most current pipelines treat sensor activations as independent categorical tokens, completely ignoring the physical layout and spatial continuity of human movement.
Methods
LastAct addresses these challenges by decoupling the recognition task into a three-stage, trajectory-guided pipeline:
- Layout-Aligned Trajectory Mapping: Instead of treating sensors as abstract IDs, LastAct projects activations onto a 2D floorplan canvas (typically resized to $32\times32$ or $64\times64$ pixels). To eliminate real-time rendering overhead, it utilizes a precomputed reusable template bank cache. It also incorporates cyclic temporal embeddings (hour of day, day of week) to capture routine patterns.
- Cross-Window Gating: A lightweight Multi-Layer Perceptron (MLP) analyzes the statistical properties (mean, standard deviation, and temporal differences) of the deep feature trajectory to determine if a window is "pure" (a single activity) or "cross" (contains an activity transition).
- Boundary Localization & Guided Masking: For contaminated cross-windows, a Transformer-based boundary detector pinpoints the exact timestep of the last activity transition. LastAct then applies a Soft-Attention Cropping strategy, using a guided mask to down-weight pre-boundary events to near-zero while preserving post-boundary evidence at full strength.
Datasets
The authors evaluated LastAct on four widely used public smart-home datasets from the CASAS project and related deployments: Milan, Kyoto7, Aruba, and Orange.
To rigorously test the model, they established two distinct evaluation protocols:
- Near-Realistic Mixed-Activity Protocol: Explicitly anchors windows at activity boundaries and parameterizes window purity (from 10% to 90% target activity events) to systematically simulate different transition states (illustrated in Figure 2).
- Raw-Stream Sliding-Window Protocol: Evaluates the model directly on continuous, unsegmented chronological data using dense sliding windows (stride 1) to mirror actual deployment conditions.
Key Insights and Ideas
- The "Segmentation Trap": While traditional HAR models are trained and evaluated primarily on pure segments, the authors show that mixed-purity windows actually dominate real streams—comprising roughly 86–88% of all windows across the datasets.
- Decoupling Segmentation from Classification: Instead of forcing a single monolithic classifier to handle both stable states and messy transitions, LastAct uses an auxiliary gate and boundary detector to "clean up" the input before passing it to the core classifier.
- Spatial Trajectories over Token IDs: Mapping sparse ambient sensor events to a continuous spatial trajectory preserves geometric relationships (e.g., room-to-room transitions). This is especially powerful when sensor names carry little semantic meaning (e.g., opaque codes like
M01).
Key Results
- Robustness under Heavy Contamination: In heavily contaminated windows (10–30% purity), where the target activity has just started, standard baselines collapse to under 20% Macro-F1. LastAct maintains a robust 47%–55% Macro-F1, demonstrating substantial gains.
- Streaming Performance: On the raw-stream streaming evaluation (stride-1), LastAct consistently achieved the highest aggregate Macro-F1 across all four datasets, outperforming strong baselines like TDOST and DCNN (e.g., jumping from 63.1% to 72.9% on Orange, and 38.6% to 44.6% on Aruba).
- Ablation Success: The custom composite loss function (incorporating cardinality constraints, last-boundary emphasis, and peakiness regularization) proved crucial, reducing the Mean Absolute Error (MAE) of boundary localization by roughly 40–45% on complex datasets compared to standard Binary Cross-Entropy.
Limitations and Future Work
- Floorplan Dependency: LastAct requires coarse spatial metadata (like room-level assignments or approximate layouts). It cannot easily deploy in commercial environments where floorplans are entirely missing or sensors are frequently moved.
- Within-Home Constraints: The current model does not establish cross-home generalization; transferring to a new home layout currently requires labeled target-home data for supervised fine-tuning.
- Single-Label Focus: It targets single-label latest-activity recognition and does not yet solve the broader problem of parallel or overlapping activities performed by multiple residents simultaneously.
Summary updated