Idea 4: Energy-Adaptive Multi-Exit Neural Networks with Harvesting Guarantees
Overview
Deploy an energy-harvesting ESP32 (solar panel + supercapacitor) that runs a multi-exit neural network. Use a control policy with formal guarantees: the supercapacitor voltage determines which exit to use, and the system provably never fails mid-inference due to power loss.
Research Gap
- Existing multi-exit TinyML adapts based on accuracy requirements, not energy availability
- No prior work provides formal guarantees that inference completes given energy constraints
- Energy-harvesting systems on ESP32 exist but use simple duty cycling, not adaptive compute
- The trade-off between inference depth and energy availability is unexplored in TinyML
Key Innovation
Bridging formal methods/control theory with TinyML. Derive a safe switching policy using model predictive control (MPC) or Lyapunov-based analysis that guarantees the capacitor voltage never drops below the threshold needed to complete the selected exit.
Hardware Requirements
| Component | Specification | Purpose |
|---|---|---|
| Main MCU | ESP32-S3-DevKitC | Compute platform |
| Harvester | 0.5W solar panel (e.g., 5V 100mA) | Energy source |
| Storage | 10F-100F supercapacitor (e.g., Eaton HV series) | Energy buffer |
| Sensor | I2S microphone or camera (OV2640) | Input source |
| Monitoring | INA219 + voltage divider | Real-time energy monitoring |
| Load | Programmable resistor or LED | Controllable discharge for testing |
Technical Approach
Phase 1: Energy Characterization
- Model supercapacitor dynamics: dV/dt = (I_harvest - I_load) / C
- Measure harvesting power under various light conditions (indoor, outdoor, shaded)
- Measure inference energy for each exit: E_early, E_mid, E_late
- Characterize leakage and quiescent currents
Phase 2: Multi-Exit Model Design
- Train a neural network with 3 exit points (early, middle, late)
- Early exit: ~70% accuracy, ~5 ms, ~1 mJ
- Middle exit: ~85% accuracy, ~15 ms, ~5 mJ
- Late exit: ~95% accuracy, ~50 ms, ~20 mJ
- Quantize to INT8; store in flash
Phase 3: Control Policy Design
- State: supercapacitor voltage V(t), recent harvesting power P_h(t)
- Action: select exit (1, 2, or 3)
- Constraint: V(t) > V_min for all t during inference
- Objective: maximize expected accuracy while satisfying constraint
Option A: Model Predictive Control (MPC)
- Predict future harvesting over horizon H (e.g., 10 seconds)
- Solve optimization: select exit that maximizes accuracy s.t. V(t+H) > V_min
- Re-plan at each decision epoch
Option B: Lyapunov-based Policy
- Define energy candidate function L(V) = (V - V_ref)
- Derive switching condition that guarantees dL/dt < 0
- Analytically prove safety (no power loss during inference)
Phase 4: Implementation
- ADC reads capacitor voltage every 10 ms
- Policy runs on ESP32 (computation is trivial: a few comparisons)
- Model inference executes selected exit
- If voltage drops unexpectedly during inference, save state and resume (checkpointing)
Phase 5: Evaluation
- Compare against:
- Always-late-exit (baseline, frequent power failures)
- Fixed threshold (simple but suboptimal)
- Oracle (knows future harvesting perfectly)
- Metrics: accuracy, completion rate, energy utilization, policy overhead
- Run for 24+ hours under real varying light conditions
Expected Results
- 100% inference completion rate (provable guarantee)
- 20-40% higher average accuracy than fixed-threshold policy
- <1% overhead for policy computation
- Formal proof of safety for Lyapunov-based approach
- Real-world 24-hour deployment trace
Target Venues
- IEEE Transactions on Computer-Aided Design (TCAD)
- ACM EMSOFT
- Nature Electronics
- IEEE Transactions on Industrial Electronics
Related Work to Cite
- Multi-exit neural networks (e.g., BranchyNet, MSDNet, Shallow-Deep Networks)
- Energy-harvesting systems (e.g., Capybara, Flicker, Ekho)
- Model predictive control for energy systems
- Lyapunov-based control for cyber-physical systems
- ESP32 power management and deep sleep modes
Risk Mitigation
| Risk | Mitigation |
|---|---|
| Supercapacitor voltage too noisy | Hardware RC filter + software median filter |
| Harvesting prediction inaccurate | Use conservative MPC with safety margin; or use Lyapunov (no prediction needed) |
| Model too large for flash | Use even smaller model; or store only one exit at a time and load dynamically |
| Real light conditions too variable | Test in controlled lab first; then deploy for 24h in office window |
Timeline (Approximate)
- Weeks 1-2: Hardware setup, energy characterization
- Weeks 3-4: Multi-exit model training and quantization
- Weeks 5-6: Control policy implementation (MPC or Lyapunov)
- Weeks 7-8: Integration and lab testing
- Weeks 9-10: Long-term deployment and paper writing