MyActivity: Bridging the Semantic Gap with Hybrid Cloud-Stream Reasoning
MyActivity: Cloud-Hosted Continuous Activity Recognition Using Ontology-Based Stream Reasoning
This paper introduces MyActivity, a cloud-hosted framework for continuous human activity recognition (AR) that employs a hybrid model combining Machine Learning for atomic activity detection and Ontology-based Stream Reasoning (C-SPARQL) for complex activity inference. By leveraging Amazon Web Services (AWS), the system achieves scalable, real-time recognition of composite behaviors like "Commuting on a Bus" using mobile accelerometer and GPS data.
TL;DR
MyActivity is a cloud-based framework that solves the "Complex Activity Recognition" problem. It uses Machine Learning on the phone for basic movements and Ontology-based C-SPARQL in the cloud to piece those movements into meaningful stories (e.g., "Commuting to Work"). It is scalable, real-time, and handles the temporal messiness of sensor data through sophisticated stream reasoning.
Context: Why Atomic recognition isn't enough
In the world of Activity Recognition (AR), researchers have long mastered detecting if you are "walking" or "running" (Atomic Activities). However, detecting more abstract, high-level behaviors like "Commuting" (which involves walking, wait times, and vehicle motion) is significantly harder.
The authors identify three major hurdles:
- Real-time necessity: Reasoning must happen "online" as data flows.
- Semantic Representation: We need a way to define what a complex activity is using standard logic (Ontologies).
- Computational Scalability: Mobile devices shouldn't melt while trying to perform complex temporal reasoning.
Methodology: The Best of Both Worlds
The genius of MyActivity lies in its layered, hybrid architecture. It doesn't choose between Machine Learning (ML) and Knowledge-Driven (KD) approaches; it uses both where they are strongest.
1. The Client Side (Local ML)
The smartphone acts as a "Feature Extractor." It takes raw accelerometer and GPS data and runs it through a J48 Decision Tree classifier.
- Why? ML is excellent at turning noisy, high-frequency signals into discrete labels.
- Result: The phone outputs a stream of RDF triples (e.g.,
User1 -> isPerforming -> Walking) rather than a flood of raw sensor numbers.
2. The Server Side (Cloud Reasoner)
The heavy lifting happens in the Amazon AWS cloud using a C-SPARQL engine.
- The Ontology: The researchers designed a custom ontology that defines properties like
componentOf,precondition, andisTerminal. - Stream Reasoning: Unlike standard SPARQL, C-SPARQL looks at "windows" of data (e.g., "the last 10 minutes of activity").
Figure 1: The MyActivity Architecture showing the pipeline from raw sensor data to cloud reasoning.
Defining Complex Activities through Logic
One of the core contributions is the formalization of complex activities. For instance, "Commuting on the Bus" isn't just one state—it's a sequence:
- Precondition: Walking
- Component: On-Bus (detected via GPS + Inactivity)
- Terminal: Walking again
The C-SPARQL query looks for this specific chain of events within a temporal window. If the pattern "Walking On-Bus Walking" is satisfied within 10 minutes, the system triggers a "Commuting" alert.
Figure 2: The ontological model defining how atomic activities compose into complex ones.
Experiments & Performance
The system was tested on a Galaxy Nexus II and Amazon EC2. The results prove the feasibility of the cloud-hybrid approach:
- On-Device Latency: Only 5.7ms—virtually unnoticeable to the user experience.
- Cloud Reasoning: Even the most expensive complex queries took ~0.6s to 1.3s to evaluate depending on the window size.
- Data Efficiency: By sending classifications instead of raw sensor data, the system only consumes about 600KB of data per day.
| Window Range | Step Size | Avg Server Execution Time (s) |
|---|---|---|
| 1 min | 5 sec | 0.6360 |
| 5 min | 5 sec | 1.3074 |
Critical Insight: The Role of "PersistedActivity"
A common pitfall in AR is "signal jitter"—a user might be walking, but a single wrong classification identifies them as "cycling" for one second. The authors introduced a PersistedActivity module. It acts as a temporal low-pass filter: an activity is only sent to the cloud if it has been consistently detected long enough to minimize noise.
Conclusion & Future Work
MyActivity demonstrates that cloud-hosted stream reasoning is a powerful tool for context-aware computing. By moving the logic to the cloud, the system becomes extensible; you can add a new "Exercise Routine" by simply registering a new C-SPARQL query, without ever updating the mobile app.
Future Outlook: The next step in this research involves "Collaborative Activity Recognition"—detecting group behaviors (like many people attending the same meeting) by correlating multiple users' data streams in the same cloud engine.
