Abstract
This post goes over the design and implementation of Aeris, an intelligent edge hardware device for real world environmental anomaly detection, predictive analysis and cloud side diagnosis. Using two Bosch BME688 sensors configured with BSEC2 in Ultra-Low-Power (ULP) mode, Aeris processes real time spatial gas, temperature and humidity metrics. The system uses localised multi variant statistic thresholds and Ordinary Least Squares linear regression to help forecast. When local anomalies are confirmed, a payload is securely sent via Alibaba cloud function compute to Qwen Cloud API for deterministic diagnosis and localised mitigation strategies. Closed loop feedback allows the cloud side agent to optimise the edge thresholds over time based on the movement of the baseline. Aeris additionally includes resilient operation fail safes through a filesystem queue to enable degradation in weaker network environments.
1.Introduction
Modern day Internet of Things devices face the trade off between processing immediately, bandwidth optimisation and diagnostic depth. A pure cloud centric architecture suffers from latency, but traditional microcontrollers lack the capacity to run deep contextual reasoning models locally. Our aim was to resolve these for the EdgeAgent track of the Global AI Hackathon Series. By distributing workloads through a integrated edge-to-cloud codesign, it allows the system runs high frequency sensor ingestion, differential error mitigation, and predictive forecasting within local constraints, reserving powerful LLM inference for structural anomaly verification and contextual mitigation guidance.
1.2 Background
The necessity for advanced real time monitors is increasingly driven by its role in health and wellbeing of occupants in for example hospitals and healthcare facilities. Reviews have shown that there is a interest in optimising these areas targeting healthcare facilities like intensive care units. A lot of these prioritise specific parameters that have been shown to be harmful to health like carbon monoxide[1]. Systems like Aeris address this by providing local data ingestion for early deviations.
Additionally, the integration of LLMs into Internet of Thing devices has presented with the problem that due to modern LLM parameter counts increasing tenfold, the memory requirements for this are too much for resource constrained edge nodes, causing a shift towards cloud based collaboration with edge devices[2]. Aeris uses this by reserving structural diagnosis to Qwen Cloud.
2.System Architecture & Edge-Cloud Co-Design
The architecture of Aeris separates duties between the edge and Alibaba cloud as shown

2.1 Edge Sensing Layer
The sensor stack uses two BME688 gas sensors operated via the BSEC2 software engine to run internal.
2.2 Cloud Integration Layer
- Alibaba Cloud Function Compute: used as the endpoint for real time heartbeats and telemetric data from the device
- Alibaba Cloud Object Storage Service: Manages historic data logging, maintaining archived payloads with structural sensor arrays and corresponding cloud diagnoses.
- Qwen Cloud Engine: Processes text prompts that are generated by the edge, providing analytics and insight to the device.
3. Local Processing & Edge Intelligence
3.1 Differential Anomaly Detection and Mismatch Isolation
Aeris' implements multi variant threshold verification across the raw temperature, relative humidity and gas resistance domains.
To help mitigate local drift, a simple sensor mismatch detection algorithm was made to calculate real-time differences between primary and secondary components.
If delta gas surpasses 80% of the calibrated baseline configuration, or if delta temperature breaches a strict 3C variance, the system flags an anomaly, bypassing standard rules to isolate internal hardware failures before they cause any false alarms.
3.2 Predictive Least-Squares Linear Regression
To enable forecasting, the firmware monitors a rolling ring buffer of the previous metrics, the edge hardware then isolates time metrics in minutes and solves an Ordinary Least Squares equation to extract a continuous slope.
where:
- n represents total valid history frames (n >= 3).
- x_i isolates chronological time indexes relative to the earliest buffer milestone, measured in minutes
- y_i tracks raw incoming physical metrics (Gas, Temp, or Humidity).
3.3 Time-to-Threshold Projections
Using the slope, the microcontroller can calculate the structural remaining operation intervals to predict when environmental parameters will violate configured margins.
if the operation interval >=0, then the edge triggers a prediction screen, broadcasting predictive metrics to the interface.
4. Asynchronous Edge-Cloud Orchestration
4.1 Asymmetric Offline Resilience Queue
To enforce robustness in unstable networks, Aeris implements two layers of asymmetric storage:
- Volatile Queue: A circular memory structure to keep tackle active jobs, throttling outbound traffic via the rate limit block to prevent flooding
- Non-Volatile Queue: If the network drops, the system serialises raw structs into dense binary matrices into the flash using LittleFS. Once the network reconnects, a verification loop reads the count and dequeues cached payloads sequentially and logs data to cloud storage endpoints.
4.3 Closed-Loop LLM Diagnostic Orchestration
When operational constraints are exceeded, diagnostics are gathered in a prompt and sent to Qwen. The model is constrained by strict rules:
- Persona Framing: evaluating paired BME688 telemetry records.
- Data Grounding: restricted to provided metrics.
- Uncertainty Mapping: If confidence metrics fall below 50%, output language must switch to speculative syntax.
- Format Constraints: Must return a raw JSON object containing exactly "diagnosis" (<30 words) and "action" (<15 words)
4.4 Automated Dynamic Baselines Auto-Tuning
Every 5 minutes, the device transmits metrics to the cloud. Qwen then analyses the local environments drift and calculates dynamic threshold updates.
if(newGas >= 1.2 && newGas <= 3.0){
g_anomalyDetector->setGasThreshold(newGas);
}
if(newTemp >= 1.0 && newTemp <= 5.0){
g_anomalyDetector->setTempThreshold(newTemp);
}
5. Evaluation and Experimental Analysis
To demonstrate structural reliability, long duration operational cycles were executed across varied scenarios. The platform maintained steady memory states under extreme load conditions:
- Edge compute footprint: Stable heap allocation on system telemetry
- Local OLS execution velocity: consistently fast processing speeds per analysis pass (around <1ms)
- Offline Recovery Capability: Successful storage and restoration of events
6. Conclusion
Aeris successfully validates the efficacy of a cloud-edge collaborative architecture for environmental monitoring. By joining on device processing and predictive least squares forecasting with the robust diagnostic capabilities of Qwen Cloud, the system achieves highly reliable, real-time environmental intelligence. This codesign effectively resolves the traditional IoT trade-offs between latency, bandwidth constraints, and deep diagnostic reasoning.
Team
- Jonathan Randall
Built for the Global AI Hackathon Series with Qwen Cloud — Track 5: EdgeAgent
Citations
[1]A. Loureiro, A. Ana Ferreira, and N. Barros, “Systematic Review of the Literature on Indoor
Air Quality in Healthcare Units and Its Effects
on Health,” BMC Public Health, vol. 25, no. 2398, 2025, doi: 10.1186/s12889-025-23445-1.
[2]Y. Liang et al., “A Comprehensive Survey on Large Language Model Compression for Artificial Intelligence Applications in Edge Systems,” IEEE Internet of Things Journal, vol. 13, no. 10, pp. 20583–20599, Mar. 2026, doi: 10.1109/jiot.2026.3675866.

Top comments (0)