CogniFlight Edge
In-cockpit pilot-fatigue detection on a Raspberry Pi: real-time computer vision fused with biometrics, streaming telemetry over TLS MQTT. 97% capstone.
- role
- Capstone team of 8 · ground-station seat
- status
- archived
- date
- 2025
- links
- source private — ask me for a walkthrough
- Python
- OpenCV
- Raspberry Pi
- Computer Vision
- MQTT
- IoT
┌─ cockpit ──────────┐
│ ◉ cam ♥ hr │
│ └───┬────┘ │
│ [ rpi ] │
└───────┬────────────┘
└─▶ mqtt ▶ cloud- capstone mark
- 97%
- EAR microsleep threshold
- <0.15
- person capstone team
- 8
The problem
Fatigue degrades a pilot long before they notice it themselves — blink duration stretches, yawns become frequent, heart-rate variability drops. By the time it is subjectively obvious, performance is already impaired. CogniFlight's answer is an edge device that watches for those signals in the cockpit and streams them to a ground station that can alert operators in real time.
What runs on the device
A Raspberry Pi with a camera runs the whole sensing pipeline locally:
- Vision — a real-time face pipeline computes the eye-aspect ratio (EAR) for blink and microsleep detection and tracks yawning frequency. Aviation-informed thresholds (EAR below 0.15 sustained across frames) flag microsleep events.
- Biometrics — heart rate and heart-rate variability (RMSSD) feed a stress index; sustained anomalies escalate the fatigue assessment.
- Environment — cabin conditions such as altitude join the fusion, since hypoxia above ~3,000 m compounds fatigue risk.
- Identity — pilots enroll with face embeddings, so a device knows whose baseline it is comparing against.
The fused indicators publish continuously to cogniflight/telemetry/{node} over TLS MQTT — a protocol chosen because cockpit connectivity is intermittent and every byte counts. If the link drops, the broker's session semantics detect it immediately; the device just keeps sensing.
Why the edge, not the cloud?
Streaming raw video from a cockpit is a non-starter: bandwidth, latency and privacy all forbid it. Computing fatigue indicators on-device means only compact telemetry leaves the aircraft — and detection keeps working even with no link at all. The constraint that shaped the edge team's work was doing real-time computer vision within a Raspberry Pi's thermal and compute budget — tuning the pipeline rather than reaching for a bigger model.
My seat
Eight of us built this. My seat was the ground station — the operator dashboards and the pilot-enrolment API — which meant living downstream of every decision the edge team made. When your UI has to render a fatigue verdict an operator will act on, you develop strong opinions about what the device should have sent you. That downstream view is the whole subject of Detecting pilot fatigue in real time on a Raspberry Pi.
Outcome
The full system — edge devices plus the cloud ground station — was our eight-person final-year capstone at Belgium Campus, presented on real hardware with live telemetry. That hardware was made possible by the Atterbury Trust, whose interest-free study loan bursary also carried my studies. It earned 97%, and it convinced me that the interesting engineering lives where hardware limits meet software design.