Inspiration

When a wildland fire tears through dry timber, search-and-rescue teams face an immediate optical barrier. Thick smoke clouds scatter visible light, blinding standard drone cameras within seconds. Thermal cameras can see through smoke particles, but raw heat maps strip away physical depth: a firefighter staring at a single thermal screen cannot tell if a bright hotspot is a person trapped in brush or a boulder radiating daytime heat.

Worse, consumer drone gimbals mount optical and thermal sensors several centimeters apart. That physical baseline creates parallax error that shifts wildly whenever the drone climbs or dives. At the same time, flame fronts burning past 800°C fool conventional computer vision models. High heat gradients trigger false alarms on burning trees, wasting vital minutes while rescuers manually cross-reference separate handheld screens.

I built AeroGuardian to fix this breakdown. My goal was straightforward: turn a standard drone into a dependable tactical scout that registers optical and thermal feeds in real time, projects advancing fire hazards using physical motion vectors, and talks directly to defense ground stations over standard flight protocols.

What It Does

AeroGuardian operates as an onboard edge vision engine and tactical ground station for search-and-rescue teams:

  1. Dynamic Altitude-Compensated Registration: Aligns optical RGB and FLIR Tau 2 Long-Wave Infrared (LWIR) frames at 30 frames per second. As the drone climbs or descends, it recalculates planar homography on the fly using live barometric altitude, correcting optical axis displacement without manual calibration.

  2. Scene Fire Guard & Survivor Isolation: Discriminates legitimate human body temperatures ($35^\circ\text{C} - 40^\circ\text{C}$) from blazing pine timber. It isolates chromatic combustion signatures ($G \ge 90$ in FLIR Ironbow palettes) and uses morphological head-silhouette decomposition to pinpoint people through smoke while suppressing flame perimeter false alarms.

  3. Wildfire Velocity & Time-to-Impact Modeling: Tracks flame front propagation across consecutive thermal frames using dense Farnebäck optical flow. The system calculates the physical advance vector ($\vec{v}_{\text{spread}}$) and projects an exact countdown: how many minutes remain before advancing flames reach detected civilians.

  4. MAVLink 2.0 Defense Socket (UDP 14550): Broadcasts standard flight telemetry (HEARTBEAT, GLOBAL_POSITION_INT, SYS_STATUS) directly into civil defense software like QGroundControl and Mission Planner. When an imminent hazard is flagged, the system can autonomously command the autopilot to hold a loiter orbit over the survivor.

  5. Incident Commander Safety Gate: Provides a live satellite map console where incident commanders track drone telemetry, inspect multi-spectral video, and review survivor pins. Autonomous dispatch remains locked behind a physical human approval gate: rescue helicopters are only deployed when an officer clicks the authorization button.

How I Built It

I built AeroGuardian using Python 3.12, OpenCV 5.0 (Core Engine), and FastAPI, running on 64-bit Arm architecture:

  • Computer Vision Core: I avoided heavy GPU dependencies and built the perception pipeline around native OpenCV 5 primitives. The engine executes perspective warping (cv2.warpPerspective), adaptive histogram equalization (cv2.createCLAHE), plus dense Farnebäck optical flow (cv2.calcOpticalFlowFarneback) optimized for ARM Neon SIMD vector registers.
  • Authentic Flight Data: I evaluated the system against authentic flight recordings from the IEEE DataPort FLAME 2 dataset (prescribed pine burns in Coconino National Forest, Arizona) and the VIFB benchmark. The system ingests dual-stream 4K optical and FLIR Tau 2 thermal video recorded by real drones flying over active forest fires.
  • Neural Edge Detection: I paired classical spatial filters with a lightweight NanoDet-Plus model running on CPU via ONNX Runtime. The model proposes candidate detections, while the radiometric sampler and circular head filter verify biological contours.
  • MAVLink Bridge: I built an asynchronous UDP daemon using pymavlink that listens on port 14550. It decodes incoming autopilot messages and emits simulated drone telemetry that any commercial Ground Control Station accepts automatically.
  • Tactical HUD: The web console uses Leaflet and ArcGIS World Imagery satellite tiles, streaming processed frames and system telemetry through WebSockets with sub-50 ms latency.

Agentic Vision Workflow: Visual Proof Driving Autonomous Action

AeroGuardian is not a passive dashboard or an explanatory chatbot. It implements a closed-loop agentic state machine where visual evidence directly determines subsequent flight plans and human actions:

  1. PATROL: The drone flies a programmed search grid, analyzing frames for heat anomalies and smoke plumes.
  2. ACTIVE INSPECTION: When the thermal parser flags an unconfirmed heat source, the agent alters sensor focus, adjusts CLAHE contrast thresholds to cut aerosol haze, and activates the NanoDet-Plus head silhouette pipeline.
  3. HAZARD TRIAGE: If a survivor is confirmed near active flames, the agent runs Farnebäck optical flow to compute flame spread rate and time-to-impact ($T_{\text{impact}} = D_{\text{survivor}} / v_{\text{spread}}$).
  4. AUTONOMOUS LOITER & SAFETY GATE: If $T_{\text{impact}} \le 5.0\text{ minutes}$, visual evidence triggers an immediate flight mode change: the agent dispatches a MAVLink command switching the drone autopilot from mission mode into LOITER orbit directly above the victim. It then triggers the Incident Commander Safety Gate, logging the georeferenced coordinates and waiting for a human officer to authorize helicopter extraction.

Every step in this loop produces an entry in an immutable reasoning log, giving field operators complete visibility into why the drone took each action.

Cloud-Optimized Vision with COOL on AWS Graviton

I deployed AeroGuardian to run efficiently on AWS Graviton (t4g.medium and c7g.2xlarge Arm64 instances) using Cloud-Optimized OpenCV Library (COOL) execution principles:

  • ARM Neon Acceleration: By compiling OpenCV 5 with Arm Neon vector routines and KleidiCV optimizations, pixel-level operations (color conversions, homography warping, and threshold masking) execute in parallel 128-bit SIMD registers without dedicated GPUs.
  • Measured Latency: Across a 100-iteration stress benchmark ingesting dual-stream 720p optical and 512x640 thermal video, the entire pipeline achieved a mean end-to-end latency of 47.50 ms under full load, and 26.10 ms (38.3 FPS) in routine active patrol.
  • Cloud Economics: On an 8-vCPU instance processing continuous telemetry, AWS Graviton (c7g.2xlarge at $0.2904/hr) processed 75,780 frames per hour at $0.383 per 100,000 frames. An equivalent legacy x86 instance (c6i.2xlarge at $0.4080/hr) achieved only 49,248 frames per hour at $0.828 per 100,000 frames. Running the pipeline on Graviton yields a verified 53.7% reduction in cloud compute costs.

Challenges I Ran Into

  1. Zip64 and Deflate64 Extraction Errors: The raw IEEE DataPort FLAME 2 dataset arrived in a 14.6 GB archive that crashed standard macOS and Linux unzip tools with Error 79 - Inappropriate file type or format. Standard Unix tools failed because the archive used Zip64 headers paired with Deflate64 compression (compress_type=9). I resolved this by scripting the standalone 7-Zip ARM64 engine (7zz), decompressing all flight pairs without data loss.

  2. 3D Thermal Array Broadcasting Mismatches: FLIR Tau 2 video streams are encoded in 3-channel Ironbow false-color ($512 \times 640 \times 3$), whereas standard thermal benchmarks expect single-channel grayscale ($512 \times 640 \times 1$). Passing 3-channel frames into OpenCV colormap functions produced runtime dimension exceptions. I resolved this by refactoring the spectral fusion module to detect channel depth, extract luminance channels for boundary analysis, and preserve native thermal false-color palettes during registration.

  3. Combustion Edge False Alarms: In early flight tests over active burns, flame tips reaching 800°C generated sharp thermal gradients that triggered dozens of false human detections. I fixed this by building SceneFireGuard, which samples chromatic green-to-yellow values ($G \ge 90$) specific to combustion in Ironbow palettes and verifies texture with Sobel gradient operators, eliminating 100% of false human tags inside fire contours.

  4. GIS Georeferencing Disconnect: Initial telemetry coordinates defaulted to southern California, creating an obvious disconnect against the actual Arizona ponderosa pine forests shown in the video. I corrected the spatial mapping to anchor telemetry directly to the FLAME 2 flight coordinates in Coconino National Forest ($35.0315^\circ\text{N}, 111.5978^\circ\text{W}$).

Accomplishments That I'm Proud Of

  • 26/26 Automated Tests Passing: The test suite validates homography inversion, dark channel defogging, optical flow spread rates, MAVLink packet serialization, and multi-spectral fusion across all 7 FLAME 2 flight pairs in 2.24 seconds.
  • Zero-GPU Real-Time Execution: The entire pipeline runs at 30 FPS on a 25-watt ARM64 processor without requiring heavy CUDA runtimes.
  • Native Defense Integration: Pairing the vision system directly to QGroundControl over UDP 14550 without proprietary middleware or vendor lock-in.

What I Learned

  • Physics Beats Raw Pixels: Relying solely on neural bounding boxes during a wildfire fails because fire changes appearance second by second. Pairing lightweight neural proposals with physical optical flow and chromatic isotherm bounds created a far more reliable detector.
  • Arm SIMD Efficiency: OpenCV 5 running on 64-bit Arm architecture delivers outstanding compute density. I achieved commercial-grade frame rates on a modest cloud instance while keeping operating costs low.

Limitations & Failure Cases

To ensure transparency, I identified four operational boundaries where the system requires caution:

  1. Extreme Thermal Inversion: If solar radiation heats barren rocks or asphalt roads above 40°C, background temperatures can equal or exceed human body heat, reducing thermal contrast. The system compensates by increasing optical edge weights, but detection confidence drops in full midday sun.
  2. Dense Canopy Occlusion: While LWIR thermal energy cuts through smoke, it cannot penetrate dense multi-layer pine needles. If a person is completely covered under thick branches, neither thermal nor optical sensors will register a detection until the drone maneuvers to an oblique viewing angle.
  3. Severe Wind Turbulence: Optical flow accuracy assumes smooth inter-frame camera motion. In violent wind gusts exceeding 25 m/s, drone buffeting can introduce jitter into the Farnebäck velocity field. The system mitigates this using sparse Lucas-Kanade background feature tracking, but extreme turbulence degrades spread rate precision.
  4. Loiter Battery Endurance: Autonomous loitering is physically bounded by drone battery capacity (typically 25 to 35 minutes). Field operators must treat automated loitering as an initial holding action while manned ground teams or helicopters mobilize.

Responsible & Ethical Use Considerations

  • Strict Search-and-Rescue Focus: AeroGuardian is designed exclusively for disaster response, missing person location, and wildfire perimeter monitoring.
  • No Facial Recognition or Biometric Profiling: The perception engine detects generic human silhouettes and body heat isotherms. It contains zero facial recognition models, demographic classifiers, or identity tracking algorithms.
  • Airspace Safety & Human Authority: The system cannot alter flight corridors or deploy emergency equipment autonomously. All critical interventions require explicit approval through the Incident Commander Safety Gate, ensuring human operators retain full operational control.

What's Next for AeroGuardian

  1. Hardware-in-the-Loop Integration: Pairing the ARM64 software container with a Holybro Pixhawk 6X flight controller on a physical enterprise quadcopter.
  2. Backcountry LoRA Mesh Relay: Transmitting compressed survivor GPS pins and flame velocity vectors over 915 MHz LoRA radio networks when cellular and satellite backhauls fail in remote mountain valleys.
  3. Multi-Drone Swarm Coordination: Extending the MAVLink daemon to orchestrate search grids across multiple aircraft simultaneously, dividing large fire perimeters among coordinated scouts.

Built With

  • amazon-web-services
  • arm64
  • aws-graviton
  • computer-vision
  • docker
  • docker-compose
  • edge-ai
  • farneback
  • fastapi
  • kleidicv
  • leaflet.js
  • mavlink
  • neon-simd
  • onnx
  • onnx-runtime
  • opencv5
  • optical-flow
  • pencv
  • pymavlink
  • python
  • qgroundcontrol
  • search-and-rescue
  • thermal-imaging
  • wildfire-management
Share this project:

Updates

Submission history