Embedded systems · Implementation study
Counter-UAS detection: tracking a five-pixel drone against open sky
A motion-first detection and tracking pipeline that pulls sub-pixel aircraft out of sensor noise, then decides whether what it found is a drone or a bird from the way it flies.
What the demo shows
The portfolio animation is a scripted reconstruction of an operator's sensor view. Target paths, candidate blips, and the track table are generated in the browser; nothing is connected to a camera. The system is scoped to detection and alerting only, never mitigation, and no detection range, probability of detection, or false-alarm rate is asserted here.
Proposed system flow
- 01Stabilized frames
- 02Over-permissive candidates
- 03Kalman track confirmation
- 04Kinematic classification
01
Start from how few pixels the target actually gets
A 30 cm airframe at 1 km subtends roughly 0.3 milliradians. Putting three or more pixels across a target that small requires about 0.1 mrad per pixel, which on a 3.45 micron sensor pitch implies a focal length near 35 mm, and a lens that long covers only about 11 degrees horizontally. Full 360-degree coverage at that sampling therefore costs thirty-plus cameras or a scanning gimbal. Because that decision is expensive and effectively irreversible, the algorithm is characterized first against a synthetic scenario generator that renders sub-pixel Gaussian targets over procedural sky and treeline backgrounds, with target size, contrast, sensor noise, mount shake, and pan all under control. Ground truth is free, and contrast can be driven down until the pipeline breaks, which is the number that should drive the optics purchase.
02
Compensate the mount before differencing anything
Camera motion compensation is not an enhancement here, it is a precondition. Tripod flex in wind produces image motion that dwarfs a five-pixel target, so every background edge becomes a detection the instant the mount moves. The background model is warped into the current frame before any subtraction: phase correlation for translation-only correction, which is fast and sufficient for tripod shake, with an ORB feature-matching and RANSAC homography path for genuine pan and tilt once the sensor sits on a gimbal.
03
Detect with morphology and robust statistics
A black-hat morphological filter is the workhorse for small dim targets: it passes compact blobs while rejecting the smooth gradients and large structures that dominate a sky-and-treeline scene. The background is an exponential moving average rather than a temporal median, which is O(1) in both memory and time per pixel instead of O(N) memory plus a sort every frame, and at these signal levels the cost in detection rate is small. The threshold comes from the median absolute deviation scaled by 1.4826 rather than a standard deviation, because a handful of bright clutter pixels would inflate a standard deviation and bury the target while the robust estimate holds steady. Connected-component analysis then emits candidates. This stage deliberately over-detects: recall is the only priority, since a target discarded here can never be recovered downstream.
04
Confirm tracks before believing them
Each candidate feeds a constant-velocity Kalman filter over the state x, y, and the two velocity components, with a discrete white-noise acceleration process model. Association is solved as a global assignment problem across a cost matrix gated by Mahalanobis distance, so the gate scales with the filter's own covariance instead of a fixed pixel radius, and a confident track tolerates less wandering than a freshly initialized one. An M-of-N rule then requires consistent kinematics over several frames before a candidate is promoted to a real track, which is a simple form of track-before-detect. This stage is what converts a deliberately permissive detector into something with a survivable alarm rate.
05
Classify on motion, not appearance
At three to eight pixels there is no texture to match, which rules out appearance-based trackers such as CSRT, KCF, or MOSSE and appearance embeddings such as DeepSORT. The trajectory is the entire signal. Features are therefore computed from the track rather than the pixels: path straightness as net displacement over path length, mean speed, speed variability, mean turn rate, hover fraction, and flap-band energy, which is the share of spectral power in the vertical-velocity transform between roughly 3.5 and 9 Hz, where a flapping bird puts strong periodic modulation and a multirotor does not. The current classifier is an intentionally interpretable hand-weighted baseline, with a gradient-boosted tree over the same feature vector as the planned replacement, because these kinematic features should transfer to real sensor data in a way pixel-level features at this target size will not.
06
Treat the false-alarm budget as the product
An operator-facing system that cries wolf gets ignored within a week and uninstalled shortly after, so the engineering target is an alarm rate low enough that the system stays switched on, not a headline detection score. That reframes the remaining work as suppression: raising confirmation thresholds, adding minimum net-displacement and velocity-plausibility gates, and alarming only on tracks the classifier calls a drone above a tuned confidence. One synthetic result shaped the design more than any other. The visually cleanest scene produced the worst false-alarm rate, because a bright uniform sky has a low median absolute deviation, which drops the robust threshold until noise crosses it. The answer is tiled local statistics instead of one global constant, a reminder that a scene-adaptive detector matters more than a better-tuned number.
07
Stay inside the regulatory boundary
This is a detect-and-alert system by design. In the United States, authority to mitigate an unmanned aircraft by jamming, capture, or kinetic means is reserved to specific federal departments under 6 U.S.C. 124n and 10 U.S.C. 130i, so mitigation is deliberately out of scope and the addressable commercial problem is detection and notification for airports, correctional facilities, stadiums, data centers, and utilities. Passive RF is worth evaluating as a complementary primary layer, since receiving is legal, coverage per unit cost is far better, and most commercial airframes broadcast an identifiable control or video link, leaving the camera as the confirmation path and the answer for autonomous or tethered aircraft that carry no RF signature.
Validation plan
- Report probability of detection at a fixed false-alarm rate, broken out by range band and background type; a single accuracy or mAP figure hides precisely the failure mode that decides whether the system is usable.
- Treat every synthetic number as an upper bound, since procedural clutter is easier than real foliage, and move the hardest low-contrast cases off compressed video onto raw frame stacks because codec compression damages exactly those targets.
- Collect real data before making any customer claim: instrumented flights against treelines with a rangefinder for truth, keeping evaluation flights strictly separate from tuning and training data.
- Sweep the detection threshold to produce a full detection-versus-false-alarm operating curve rather than quoting one tuned point.
- Confirm behavior on a global-shutter sensor, because rolling shutter distorts fast movers and corrupts frame differencing.
More in embedded systems
Have a similar problem to solve?
Discuss your project