Lab Notes - Teaching AI Object Permanence & Motion
How we eliminated the Ping-Pong bug using ByteTrack spatial association and Exponential Moving Average temporal smoothing.
Picture setting your mug down next to your laptop. If you glance back and forth between them, your brain instantly recognizes that both objects are sitting still. You don't re-identify them as "new objects" every time your eye moves.
When processing raw video frames through lightweight edge AI, however, models can lack this basic sense of permanence. During early testing of DVIE v1, we encountered what we nicknamed the **"Ping-Pong Oscillation Bug."**
The Ping-Pong Bug & How We Solved It
In v1, detection was evaluated frame-by-frame. If the camera saw a person and a chair simultaneously, slight variations in frame confidence caused the system to flip back and forth between labels every 50 milliseconds. The audio engine would get stuck in a loop: *"Person... Chair... Person... Chair..."*
To a visually impaired user, this creates overwhelming auditory noise.
1. Persistent Spatial Memory (ByteTrack)
In DVIE v1.5, we decoupled raw detection from spatial memory by integrating persistent multi-object tracking (`bytetrack.yaml`).
Instead of treating every video frame as a brand-new world, DVIE v1.5 assigns persistent tracking IDs to objects (e.g., *Track ID #14: Person*, *Track ID #18: Bench*).
Coupled with a per-track cooldown dictionary, the engine remembers what it has already told you. Once a hazard is announced, it enters a **5-second cooldown timer**. It tells you about the obstacle once, and then remains intelligently silent while tracking its position in the background.
2. Filtering Camera Jitter with EMA Motion Smoothing
Another challenge in wearable AI is natural human movement. When you walk, your head subtly bobs up and down. To a raw camera model, a static table can appear to rapidly grow and shrink, triggering false alarms like *"Warning: Table approaching!"* when you are standing completely still.
To solve this, we implemented **Exponential Moving Average (EMA)** height filtering to smooth out frame-to-frame noise:
$$H_{\text{smoothed}} = (\alpha \times H_{\text{current}}) + ((1 - \alpha) \times H_{\text{prev}})$$
Using an alpha factor ($\alpha = 0.35$), DVIE v1.5 smooths out single-frame camera bounces:
Raw Frame Heights: [ 120px -> 145px -> 118px -> 140px ] (Noisy / False Alarms)
Smoothed EMA Graph: [ 120px ---- 124px ---- 125px ---- 127px ] (Stable Baseline)Now, an object is only flagged as "Approaching" if its smoothed bounding box consistently expands by more than 15% across consecutive frames.
By layering simple, robust mathematics over neural models, we turned erratic visual data into calm, reliable guidance.
// OTHER LAB DISPATCHES
Announcing DVIE v1.5 - Real-World Intelligence Beyond the Cloud
Today, we are announcing Docilis Visual Intelligence Engine (DVIE) v1.5, the software architecture powering Project AI4Sight. Here is how we engineered smart interruption audio queues, 5-zone spatial grids, and zero-cloud privacy.
Embedded Systems / Edge HardwareLab Notes - Squeezing Heavy AI onto a $100 Chip
Building high-tier AI software inside a cloud lab with unlimited compute is one thing. Making it run on a $100 credit-card-sized board on smart glasses is a completely different engineering challenge.
