
Computer vision · live system
Greenhouse person detection and monitoring
live; my detector since 21 Sep 2026, v11 since 28 Sep
Person detection and site control for a greenhouse, on a 4G line behind CGNAT. I trained the detector it now uses.
94.1% vs 49.8% person recall at a 3.7% false-positive rate, the 21 Sep model against stock YOLO11s
Details
Problem
The greenhouse needs an alarm when a person is there, day or night, and everything has to go over the 4G line. At the false-positive rate of that comparison (3.7%), stock YOLO11s found 49.8% of people.

What I did
- The system: five DVR cameras, a PTZ camera frozen since 23 September, an ESP32 climate node, a smart plug that switches the irrigation pump from the app with an automatic shut-off, and a web app for alerts, live view and an event calendar. Detection runs on a home server: on its GPU when it is free, on the CPU while a batch job holds the card.
- The measurement mistakes behind the detector, from a test that could not fail to a gain I took back, are in the case study.
- What worked: a D-FINE-X teacher labelled 125,900 frames. After dropping uncertain ones and mining static scene clutter as hard negatives, a 19.4M-parameter D-FINE-M student trained on 13,668 of them in 70 minutes on an RTX 4060 Ti. It went live on 21 September 2026 after a shadow run with zero extra alarms (740 live polls and 8,505 archive frames), behind an adapter that left the production code untouched.
- Before touching the 4G line I measured what lower resolution costs: at the same false-positive rate, recall was 95% at 1080p and 94% at 352x288. So detection moved to the DVR sub-stream.
- On 28 September a newer model (v11), trained with another 702 frames I had labelled, took over person detection.
- Built on-demand live view (HEVC to H.264 HLS), and a GPU lease that moves live inference to the CPU while a batch job has the card and back afterwards, even if the job crashes.

Result
- On 2,918 frames I labelled myself, from days that do not overlap training, the 21 September model found 94.1% of people against 49.8% for stock YOLO11s, at a 3.7% false-positive rate. AUC 0.981 against 0.863. At night, both at a 0.50 threshold, 93.5% against 38.1%.
- v11 against the 21 September model on 518 frames I labelled: recall at a 2% false-positive rate 89.6% against 83.8% (seed spread 3.0 points), AUC 0.984 against 0.976 (spread 0.001).
- 4G traffic went from 4.2 GB a day to a median of 2.2 GB, with 1.5 to 3.3 GB over the 13 days from 22 September to 4 October.
Limits
- Its negatives were drawn from frames an older model had called a person, which inflates the false-positive rate.
- At night, on 163 empty frames, the false-alarm rate was 8.6% for the 21 September model and 4.9%, 10.4% and 9.8% for three seeds of v11. The vehicle detector stays on the 21 September model: v11 flagged a white wall as a vehicle on camera 5 in 261 frames, where the older model flagged none.
- The score calibration for day frames was fitted on 1,218 frames that an AI assistant labelled, most of them by eye, not me. Both check sets are my labels, chosen by model scores.
- The camera 3 archive was empty on four days between 24 September and 1 October, and all five DVR cameras went stale in four episodes on 2 October; causes unknown. Since v11 went live, detection ran on the CPU for about three quarters of the hours (a batch job holds the GPU), and polling averaged 17 s per camera against a design value of 8 s.
Tools
- Python
- PyTorch
- D-FINE
- ONNX Runtime
- OpenCV
- FFmpeg
- HLS
- ESP32
- systemd




